mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-07-27 08:14:08 +08:00
Compare commits
59 Commits
2b18fc4886
...
f70ca3d190
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f70ca3d190 | ||
![]() |
f16ab5e3df | ||
![]() |
7ad655dec6 | ||
![]() |
581b7a2a6d | ||
![]() |
cebd6118fd | ||
![]() |
a492586308 | ||
![]() |
2f27a9c307 | ||
![]() |
b710519728 | ||
![]() |
acf433fb83 | ||
![]() |
0071a4586a | ||
![]() |
45ebaabcd7 | ||
![]() |
b2f456d6c5 | ||
![]() |
08534c277e | ||
![]() |
bbd3b5b054 | ||
![]() |
374647601d | ||
![]() |
c934365929 | ||
![]() |
f33287c50f | ||
![]() |
477c1c32f8 | ||
![]() |
4e01443a26 | ||
![]() |
d9e9a589db | ||
![]() |
1339dcddce | ||
![]() |
84de755eb6 | ||
![]() |
7058c8e0d0 | ||
![]() |
12b4205c3c | ||
![]() |
374eaa9301 | ||
![]() |
9ddcd1c154 | ||
![]() |
7473db9515 | ||
![]() |
6d6789a4c5 | ||
![]() |
f9d5927101 | ||
![]() |
57c866c4d4 | ||
![]() |
4d36ebe654 | ||
![]() |
182c9adf00 | ||
![]() |
b43d8d2298 | ||
![]() |
f17b6fe703 | ||
![]() |
e2303234e8 | ||
![]() |
96e4fe5125 | ||
![]() |
f6fe6312bc | ||
![]() |
4c4d5e70c6 | ||
![]() |
d6f46598ff | ||
![]() |
78a7577575 | ||
![]() |
e56e6f9565 | ||
![]() |
6a4ae71992 | ||
![]() |
fd97777f91 | ||
![]() |
13e9dc9cd6 | ||
![]() |
51b9d7fce1 | ||
![]() |
3d37d37d38 | ||
![]() |
f1fe1c5f4e | ||
![]() |
b830ef72e1 | ||
![]() |
1ac3b3565f | ||
![]() |
76d1f8cf5c | ||
![]() |
70d64b0da1 | ||
![]() |
d10dba568d | ||
![]() |
2c6d0dba9e | ||
![]() |
dfd56bbcb3 | ||
![]() |
a7a3b4e2e1 | ||
![]() |
ed1ea104eb | ||
![]() |
511ba9bd6a | ||
![]() |
ea442e0608 | ||
![]() |
86116b9423 |
@ -27,8 +27,11 @@ func main() {
|
||||
)
|
||||
if flagRunNightly {
|
||||
var version badversion.Version
|
||||
version, err = build_shared.ReadTagVersion()
|
||||
version, err = build_shared.ReadTagVersionRev()
|
||||
if err == nil {
|
||||
if version.PreReleaseIdentifier == "" {
|
||||
version.Patch++
|
||||
}
|
||||
versionStr = version.String()
|
||||
}
|
||||
} else {
|
||||
|
@ -102,12 +102,12 @@ func NewWithOptions(options Options) (N.Dialer, error) {
|
||||
}
|
||||
dnsQueryOptions.Transport = transport
|
||||
resolveFallbackDelay = time.Duration(dialOptions.FallbackDelay)
|
||||
} else if options.NewDialer {
|
||||
return nil, E.New("missing domain resolver for domain server address")
|
||||
} else {
|
||||
transports := dnsTransport.Transports()
|
||||
if len(transports) < 2 {
|
||||
dnsQueryOptions.Transport = dnsTransport.Default()
|
||||
} else if options.NewDialer {
|
||||
return nil, E.New("missing domain resolver for domain server address")
|
||||
} else {
|
||||
deprecated.Report(options.Context, deprecated.OptionMissingDomainResolver)
|
||||
}
|
||||
|
@ -15,8 +15,6 @@ func TruncateDNSMessage(request *dns.Msg, response *dns.Msg, headroom int) (*buf
|
||||
}
|
||||
responseLen := response.Len()
|
||||
if responseLen > maxLen {
|
||||
copyResponse := *response
|
||||
response = ©Response
|
||||
response.Truncate(maxLen)
|
||||
}
|
||||
buffer := buf.NewSize(headroom*2 + 1 + responseLen)
|
||||
|
@ -2,7 +2,7 @@
|
||||
icon: material/alert-decagram
|
||||
---
|
||||
|
||||
#### 1.12.0-alpha.23
|
||||
#### 1.12.0-alpha.21
|
||||
|
||||
* Fixes and improvements
|
||||
|
||||
|
2
go.mod
2
go.mod
@ -35,7 +35,7 @@ require (
|
||||
github.com/sagernet/sing-tun v0.6.2-0.20250319123703-35b5747b44ec
|
||||
github.com/sagernet/sing-vmess v0.2.0
|
||||
github.com/sagernet/smux v0.0.0-20231208180855-7041f6ea79e7
|
||||
github.com/sagernet/tailscale v1.80.3-mod.2
|
||||
github.com/sagernet/tailscale v1.80.3-mod.0
|
||||
github.com/sagernet/utls v1.6.7
|
||||
github.com/sagernet/wireguard-go v0.0.1-beta.5
|
||||
github.com/sagernet/ws v0.0.0-20231204124109-acfe8907c854
|
||||
|
4
go.sum
4
go.sum
@ -196,8 +196,8 @@ github.com/sagernet/sing-vmess v0.2.0 h1:pCMGUXN2k7RpikQV65/rtXtDHzb190foTfF9IGT
|
||||
github.com/sagernet/sing-vmess v0.2.0/go.mod h1:jDAZ0A0St1zVRkyvhAPRySOFfhC+4SQtO5VYyeFotgA=
|
||||
github.com/sagernet/smux v0.0.0-20231208180855-7041f6ea79e7 h1:DImB4lELfQhplLTxeq2z31Fpv8CQqqrUwTbrIRumZqQ=
|
||||
github.com/sagernet/smux v0.0.0-20231208180855-7041f6ea79e7/go.mod h1:FP9X2xjT/Az1EsG/orYYoC+5MojWnuI7hrffz8fGwwo=
|
||||
github.com/sagernet/tailscale v1.80.3-mod.2 h1:hT0CI74q727EuCcgQ+T4pvon8V0aoi4vTAxah7GsNMQ=
|
||||
github.com/sagernet/tailscale v1.80.3-mod.2/go.mod h1:EBxXsWu4OH2ELbQLq32WoBeIubG8KgDrg4/Oaxjs6lI=
|
||||
github.com/sagernet/tailscale v1.80.3-mod.0 h1:oHIdivbR/yxoiA9d3a2rRlhYn2shY9XVF35Rr8jW508=
|
||||
github.com/sagernet/tailscale v1.80.3-mod.0/go.mod h1:EBxXsWu4OH2ELbQLq32WoBeIubG8KgDrg4/Oaxjs6lI=
|
||||
github.com/sagernet/utls v1.6.7 h1:Ep3+aJ8FUGGta+II2IEVNUc3EDhaRCZINWkj/LloIA8=
|
||||
github.com/sagernet/utls v1.6.7/go.mod h1:Uua1TKO/FFuAhLr9rkaVnnrTmmiItzDjv1BUb2+ERwM=
|
||||
github.com/sagernet/wireguard-go v0.0.1-beta.5 h1:aBEsxJUMEONwOZqKPIkuAcv4zJV5p6XlzEN04CF0FXc=
|
||||
|
@ -4,7 +4,6 @@ import (
|
||||
"bytes"
|
||||
"context"
|
||||
|
||||
E "github.com/sagernet/sing/common/exceptions"
|
||||
"github.com/sagernet/sing/common/json"
|
||||
)
|
||||
|
||||
@ -32,7 +31,7 @@ func (o *Options) UnmarshalJSONContext(ctx context.Context, content []byte) erro
|
||||
return err
|
||||
}
|
||||
o.RawMessage = content
|
||||
return checkOptions(o)
|
||||
return nil
|
||||
}
|
||||
|
||||
type LogOptions struct {
|
||||
@ -44,52 +43,3 @@ type LogOptions struct {
|
||||
}
|
||||
|
||||
type StubOptions struct{}
|
||||
|
||||
func checkOptions(options *Options) error {
|
||||
err := checkInbounds(options.Inbounds)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = checkOutbounds(options.Outbounds, options.Endpoints)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func checkInbounds(inbounds []Inbound) error {
|
||||
seen := make(map[string]bool)
|
||||
for _, inbound := range inbounds {
|
||||
if inbound.Tag == "" {
|
||||
continue
|
||||
}
|
||||
if seen[inbound.Tag] {
|
||||
return E.New("duplicate inbound tag: ", inbound.Tag)
|
||||
}
|
||||
seen[inbound.Tag] = true
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func checkOutbounds(outbounds []Outbound, endpoints []Endpoint) error {
|
||||
seen := make(map[string]bool)
|
||||
for _, outbound := range outbounds {
|
||||
if outbound.Tag == "" {
|
||||
continue
|
||||
}
|
||||
if seen[outbound.Tag] {
|
||||
return E.New("duplicate outbound/endpoint tag: ", outbound.Tag)
|
||||
}
|
||||
seen[outbound.Tag] = true
|
||||
}
|
||||
for _, endpoint := range endpoints {
|
||||
if endpoint.Tag == "" {
|
||||
continue
|
||||
}
|
||||
if seen[endpoint.Tag] {
|
||||
return E.New("duplicate outbound/endpoint tag: ", endpoint.Tag)
|
||||
}
|
||||
seen[endpoint.Tag] = true
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -2,10 +2,8 @@ package tailscale
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/netip"
|
||||
"net/url"
|
||||
"os"
|
||||
@ -149,17 +147,6 @@ func NewEndpoint(ctx context.Context, router adapter.Router, logger log.ContextL
|
||||
return dnsRouter.Lookup(ctx, host, outboundDialer.(dialer.ResolveDialer).QueryOptions())
|
||||
},
|
||||
DNS: &dnsConfigurtor{},
|
||||
HTTPClient: &http.Client{
|
||||
Transport: &http.Transport{
|
||||
ForceAttemptHTTP2: true,
|
||||
DialContext: func(ctx context.Context, network, address string) (net.Conn, error) {
|
||||
return outboundDialer.DialContext(ctx, network, M.ParseSocksaddr(address))
|
||||
},
|
||||
TLSClientConfig: &tls.Config{
|
||||
RootCAs: adapter.RootPoolFromContext(ctx),
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
return &Endpoint{
|
||||
Adapter: endpoint.NewAdapter(C.TypeTailscale, tag, []string{N.NetworkTCP, N.NetworkUDP}, nil),
|
||||
@ -459,10 +446,6 @@ func (t *Endpoint) NewPacketConnectionEx(ctx context.Context, conn N.PacketConn,
|
||||
t.router.RoutePacketConnectionEx(ctx, conn, metadata, onClose)
|
||||
}
|
||||
|
||||
func (t *Endpoint) Server() *tsnet.Server {
|
||||
return t.server
|
||||
}
|
||||
|
||||
func addressFromAddr(destination netip.Addr) tcpip.Address {
|
||||
if destination.Is6() {
|
||||
return tcpip.AddrFrom16(destination.As16())
|
||||
|
Loading…
x
Reference in New Issue
Block a user