Compare commits

..

99 Commits

Author SHA1 Message Date
renovate[bot]
ea9096ae59
[dependencies] Update golangci/golangci-lint-action action to v8 2025-06-04 15:38:26 +00:00
世界
b03d912eb5
documentation: Bump version 2025-06-04 23:37:40 +08:00
世界
bf0611fa0b
Fix missing home for derp service 2025-06-04 23:37:14 +08:00
Zero Clover
92c6119109
documentation: Fix services 2025-06-04 23:37:14 +08:00
世界
f02de6ec00
Fix dns.client_subnet ignored 2025-06-04 23:37:14 +08:00
世界
1499dac0e1
documentation: Minor fixes 2025-06-04 23:37:13 +08:00
世界
cccd9622cc
Fix tailscale forward 2025-06-04 23:37:13 +08:00
世界
eb9e6beade
Minor fixes 2025-06-04 23:37:13 +08:00
世界
183c09a53b
Add SSM API service 2025-06-04 23:37:13 +08:00
世界
c09b96aedb
Add resolved service and DNS server 2025-06-04 23:37:12 +08:00
世界
4a162455c7
Add DERP service 2025-06-04 23:37:12 +08:00
世界
c4889e76ff
Add service component type 2025-06-04 23:37:12 +08:00
世界
03fba739e4
Fix tproxy tcp control 2025-06-04 23:37:12 +08:00
愚者
338bc709b4
release: Fix build tags for android
Signed-off-by: 愚者 <11926619+FansChou@users.noreply.github.com>
2025-06-04 23:37:12 +08:00
世界
936220aa64
prevent creation of bind and mark controls on unsupported platforms 2025-06-04 23:37:11 +08:00
PuerNya
9336bf802f
documentation: Fix description of reject DNS action behavior 2025-06-04 23:37:11 +08:00
Restia-Ashbell
4ecea1ae2b
Fix TLS record fragment 2025-06-04 23:37:11 +08:00
世界
20e462b577
Add missing accept_routes option for Tailscale 2025-06-04 23:37:11 +08:00
世界
46e97a5c7c
Add TLS record fragment support 2025-06-04 23:37:11 +08:00
世界
91a229b26e
release: Update Go to 1.24.3 2025-06-04 23:37:10 +08:00
世界
68cdf2246f
Fix set edns0 client subnet 2025-06-04 23:37:10 +08:00
世界
168548c8cc
Update minor dependencies 2025-06-04 23:37:10 +08:00
世界
14619fb5bd
Update certmagic and providers 2025-06-04 23:37:10 +08:00
世界
7760aa3e6c
Update protobuf and grpc 2025-06-04 23:37:09 +08:00
世界
af73e784f1
Add control options for listeners 2025-06-04 23:37:09 +08:00
世界
c44e127064
Update quic-go to v0.52.0 2025-06-04 23:37:08 +08:00
世界
7345152a8a
Update utls to v1.7.2 2025-06-04 23:37:08 +08:00
世界
979d8054a8
Handle EDNS version downgrade 2025-06-04 23:37:08 +08:00
世界
86841c36b5
documentation: Fix anytls padding scheme description 2025-06-04 23:37:07 +08:00
安容
d637de0043
Report invalid DNS address early 2025-06-04 23:37:07 +08:00
世界
1a9138ae4a
Fix wireguard listen_port 2025-06-04 23:37:07 +08:00
世界
67178bbd82
clash-api: Add more meta api 2025-06-04 23:37:06 +08:00
世界
c4b97029d2
Fix DNS lookup 2025-06-04 23:37:06 +08:00
世界
f7edfc5867
Fix fetch ECH configs 2025-06-04 23:37:06 +08:00
reletor
a6ca8e64ea
documentation: Minor fixes 2025-06-04 23:37:05 +08:00
caelansar
34b45bcd6b
Fix callback deletion in UDP transport 2025-06-04 23:37:05 +08:00
世界
1aa3791ced
documentation: Try to make the play review happy 2025-06-04 23:37:05 +08:00
世界
3313578a09
Fix missing handling of legacy domain_strategy options 2025-06-04 23:37:04 +08:00
世界
a5b9cd9696
Improve local DNS server 2025-06-04 23:37:04 +08:00
anytls
c1167df04d
Update anytls
Co-authored-by: anytls <anytls>
2025-06-04 23:37:04 +08:00
世界
c60adfd4b8
Fix DNS dialer 2025-06-04 23:37:03 +08:00
世界
f9d4b00e78
release: Skip override version for iOS 2025-06-04 23:37:03 +08:00
iikira
d262c8bff9
Fix UDP DNS server crash
Signed-off-by: iikira <i2@mail.iikira.com>
2025-06-04 23:37:03 +08:00
ReleTor
0b7ee68187
Fix fetch ECH configs 2025-06-04 23:37:02 +08:00
世界
84a3a364d1
Allow direct outbounds without domain_resolver 2025-06-04 23:37:02 +08:00
世界
186ecfcc61
Fix Tailscale dialer 2025-06-04 23:37:02 +08:00
dyhkwong
f92c3e9b54
Fix DNS over QUIC stream close 2025-06-04 23:37:02 +08:00
anytls
45f240f562
Update anytls
Co-authored-by: anytls <anytls>
2025-06-04 23:37:01 +08:00
Rambling2076
7b2dad1073
Fix missing with_tailscale in Dockerfile
Signed-off-by: Rambling2076 <Rambling2076@proton.me>
2025-06-04 23:37:01 +08:00
世界
955edac785
Fail when default DNS server not found 2025-06-04 23:37:01 +08:00
世界
21dc56b47e
Update gVisor to 20250319.0 2025-06-04 23:37:01 +08:00
世界
1d7a20a879
Explicitly reject detour to empty direct outbounds 2025-06-04 23:37:00 +08:00
世界
710b26c95d
Add netns support 2025-06-04 23:37:00 +08:00
世界
99154e8221
Add wildcard name support for predefined records 2025-06-04 23:36:59 +08:00
世界
0f0bdddc09
Remove map usage in options 2025-06-04 23:36:59 +08:00
世界
b2003ff63c
Fix unhandled DNS loop 2025-06-04 23:36:59 +08:00
世界
666fcf3342
Add wildcard-sni support for shadow-tls inbound 2025-06-04 23:36:59 +08:00
k9982874
b3257446a9
Add ntp protocol sniffing 2025-06-04 23:36:58 +08:00
世界
6f0917af2c
option: Fix marshal legacy DNS options 2025-06-04 23:36:58 +08:00
世界
c997cd5995
Make domain_resolver optional when only one DNS server is configured 2025-06-04 23:36:58 +08:00
世界
51e1ea0ff2
Fix DNS lookup context pollution 2025-06-04 23:36:57 +08:00
世界
d2aa704bd6
Fix http3 DNS server connecting to wrong address 2025-06-04 23:36:57 +08:00
Restia-Ashbell
d24c2ff9ef
documentation: Fix typo 2025-06-04 23:36:57 +08:00
anytls
30bdf826cb
Update sing-anytls
Co-authored-by: anytls <anytls>
2025-06-04 23:36:57 +08:00
k9982874
13f283554f
Fix hosts DNS server 2025-06-04 23:36:56 +08:00
世界
22b96aa95e
Fix UDP DNS server crash 2025-06-04 23:36:56 +08:00
世界
9cd361400c
documentation: Fix missing ip_accept_any DNS rule option 2025-06-04 23:36:55 +08:00
世界
9b34001232
Fix anytls dialer usage 2025-06-04 23:36:55 +08:00
世界
38f83819df
Move predefined DNS server to rule action 2025-06-04 23:36:55 +08:00
世界
a79799bb08
Fix domain resolver on direct outbound 2025-06-04 23:36:54 +08:00
Zephyruso
5f037b01f4
Fix missing AnyTLS display name 2025-06-04 23:36:54 +08:00
anytls
09ca2d0d91
Update sing-anytls
Co-authored-by: anytls <anytls>
2025-06-04 23:36:54 +08:00
Estel
61cbe8ed5d
documentation: Fix typo
Signed-off-by: Estel <callmebedrockdigger@gmail.com>
2025-06-04 23:36:54 +08:00
TargetLocked
9088fb312f
Fix parsing legacy DNS options 2025-06-04 23:36:53 +08:00
世界
0c29d16733
Fix DNS fallback 2025-06-04 23:36:53 +08:00
世界
75e15c7ac6
documentation: Fix missing hosts DNS server 2025-06-04 23:36:52 +08:00
anytls
e63154f746
Add MinIdleSession option to AnyTLS outbound
Co-authored-by: anytls <anytls>
2025-06-04 23:36:52 +08:00
ReleTor
b28721f08b
documentation: Minor fixes 2025-06-04 23:36:52 +08:00
libtry486
2eaa348762
documentation: Fix typo
fix typo

Signed-off-by: libtry486 <89328481+libtry486@users.noreply.github.com>
2025-06-04 23:36:52 +08:00
Alireza Ahmadi
76d94b0674
Fix Outbound deadlock 2025-06-04 23:36:52 +08:00
世界
3bbfff6e8b
documentation: Fix AnyTLS doc 2025-06-04 23:36:51 +08:00
anytls
6d7d1e9ada
Add AnyTLS protocol 2025-06-04 23:36:50 +08:00
世界
f709b1a265
Migrate to stdlib ECH support 2025-06-04 23:36:50 +08:00
世界
d35558a771
Add fallback local DNS server for iOS 2025-06-04 23:36:50 +08:00
世界
f1fc578414
Get darwin local DNS server from libresolv 2025-06-04 23:36:49 +08:00
世界
c498c5e48f
Improve resolve action 2025-06-04 23:36:49 +08:00
世界
e3aaa27d82
Add back port hopping to hysteria 1 2025-06-04 23:36:48 +08:00
xchacha20-poly1305
d6949a4ea4
Remove single quotes of raw Moziila certs 2025-06-04 23:36:48 +08:00
世界
19febe44cb
Add Tailscale endpoint 2025-06-04 23:36:47 +08:00
世界
f7adac3847
Build legacy binaries with latest Go 2025-06-04 23:36:47 +08:00
世界
1c63ddc69e
documentation: Remove outdated icons 2025-06-04 23:36:47 +08:00
世界
c37d2627ee
documentation: Certificate store 2025-06-04 23:36:46 +08:00
世界
e447da0f41
documentation: TLS fragment 2025-06-04 23:36:46 +08:00
世界
ed35d7a44f
documentation: Outbound domain resolver 2025-06-04 23:36:45 +08:00
世界
55254639d9
documentation: Refactor DNS 2025-06-04 23:36:45 +08:00
世界
f80e4ff91a
Add certificate store 2025-06-04 23:36:45 +08:00
世界
207a40fbb5
Add TLS fragment support 2025-06-04 23:36:45 +08:00
世界
2645466e48
refactor: Outbound domain resolver 2025-06-04 23:36:44 +08:00
世界
8ab0427199
refactor: DNS 2025-06-04 23:36:44 +08:00
9 changed files with 15 additions and 33 deletions

View File

@ -8,7 +8,6 @@
--deb-field "Bug: https://github.com/SagerNet/sing-box/issues"
--no-deb-generate-changes
--config-files /etc/sing-box/config.json
--after-install release/config/sing-box.postinst
release/config/config.json=/etc/sing-box/config.json

View File

@ -97,6 +97,10 @@ func NewDefault(ctx context.Context, options option.DialerOptions) (*DefaultDial
} else if networkManager.AutoDetectInterface() {
if platformInterface != nil {
networkStrategy = (*C.NetworkStrategy)(options.NetworkStrategy)
if networkStrategy == nil {
networkStrategy = common.Ptr(C.NetworkStrategyDefault)
defaultNetworkStrategy = true
}
networkType = common.Map(options.NetworkType, option.InterfaceType.Build)
fallbackNetworkType = common.Map(options.FallbackNetworkType, option.InterfaceType.Build)
if networkStrategy == nil && len(networkType) == 0 && len(fallbackNetworkType) == 0 {
@ -108,10 +112,6 @@ func NewDefault(ctx context.Context, options option.DialerOptions) (*DefaultDial
if networkFallbackDelay == 0 && defaultOptions.FallbackDelay != 0 {
networkFallbackDelay = defaultOptions.FallbackDelay
}
if networkStrategy == nil {
networkStrategy = common.Ptr(C.NetworkStrategyDefault)
defaultNetworkStrategy = true
}
bindFunc := networkManager.ProtectFunc()
dialer.Control = control.Append(dialer.Control, bindFunc)
listener.Control = control.Append(listener.Control, bindFunc)

View File

@ -12,6 +12,7 @@ import (
"github.com/sagernet/sing/common"
"github.com/sagernet/sing/common/bufio"
E "github.com/sagernet/sing/common/exceptions"
M "github.com/sagernet/sing/common/metadata"
N "github.com/sagernet/sing/common/network"
@ -75,11 +76,10 @@ func (c *slowOpenConn) Write(b []byte) (n int, err error) {
return c.conn.Write(b)
default:
}
conn, err := c.dialer.DialContext(c.ctx, c.network, c.destination.String(), b)
c.conn, err = c.dialer.DialContext(c.ctx, c.network, c.destination.String(), b)
if err != nil {
c.err = err
} else {
c.conn = conn
c.conn = nil
c.err = E.Cause(err, "dial tcp fast open")
}
n = len(b)
close(c.create)

View File

@ -2,10 +2,6 @@
icon: material/alert-decagram
---
#### 1.12.0-beta.22
* Fixes and improvements
#### 1.12.0-beta.21
* Fix missing `home` option for DERP service **1**

2
go.mod
View File

@ -35,7 +35,7 @@ require (
github.com/sagernet/sing-shadowsocks2 v0.2.1
github.com/sagernet/sing-shadowtls v0.2.1-0.20250503051639-fcd445d33c11
github.com/sagernet/sing-tun v0.6.6-0.20250428031943-0686f8c4f210
github.com/sagernet/sing-vmess v0.2.4-0.20250605032146-38cc72672c88
github.com/sagernet/sing-vmess v0.2.4-0.20250527060135-661c827800bc
github.com/sagernet/smux v1.5.34-mod.2
github.com/sagernet/tailscale v1.80.3-mod.5
github.com/sagernet/wireguard-go v0.0.1-beta.7

4
go.sum
View File

@ -182,8 +182,8 @@ github.com/sagernet/sing-shadowtls v0.2.1-0.20250503051639-fcd445d33c11 h1:tK+75
github.com/sagernet/sing-shadowtls v0.2.1-0.20250503051639-fcd445d33c11/go.mod h1:sWqKnGlMipCHaGsw1sTTlimyUpgzP4WP3pjhCsYt9oA=
github.com/sagernet/sing-tun v0.6.6-0.20250428031943-0686f8c4f210 h1:6H4BZaTqKI3YcDMyTV3E576LuJM4S4wY99xoq2T1ECw=
github.com/sagernet/sing-tun v0.6.6-0.20250428031943-0686f8c4f210/go.mod h1:fisFCbC4Vfb6HqQNcwPJi2CDK2bf0Xapyz3j3t4cnHE=
github.com/sagernet/sing-vmess v0.2.4-0.20250605032146-38cc72672c88 h1:0pVm8sPOel+BoiCddW3pV3cKDKEaSioVTYDdTSKjyFI=
github.com/sagernet/sing-vmess v0.2.4-0.20250605032146-38cc72672c88/go.mod h1:IL8Rr+EGwuqijszZkNrEFTQDKhilEpkqFqOlvdpS6/w=
github.com/sagernet/sing-vmess v0.2.4-0.20250527060135-661c827800bc h1:kd3olNfnf/1EAAHDQm0flN9eihyjpeQDKdGONlLtXfc=
github.com/sagernet/sing-vmess v0.2.4-0.20250527060135-661c827800bc/go.mod h1:IL8Rr+EGwuqijszZkNrEFTQDKhilEpkqFqOlvdpS6/w=
github.com/sagernet/smux v1.5.34-mod.2 h1:gkmBjIjlJ2zQKpLigOkFur5kBKdV6bNRoFu2WkltRQ4=
github.com/sagernet/smux v1.5.34-mod.2/go.mod h1:0KW0+R+ycvA2INW4gbsd7BNyg+HEfLIAxa5N02/28Zc=
github.com/sagernet/tailscale v1.80.3-mod.5 h1:7V7z+p2C//TGtff20pPnDCt3qP6uFyY62peJoKF9z/A=

View File

@ -1,3 +0,0 @@
#!/bin/sh
systemd-sysusers sing-box.conf

View File

@ -36,7 +36,7 @@ func (r *Router) hijackDNSStream(ctx context.Context, conn net.Conn, metadata ad
}
}
func (r *Router) hijackDNSPacket(ctx context.Context, conn N.PacketConn, packetBuffers []*N.PacketBuffer, metadata adapter.InboundContext, onClose N.CloseHandlerFunc) error {
func (r *Router) hijackDNSPacket(ctx context.Context, conn N.PacketConn, packetBuffers []*N.PacketBuffer, metadata adapter.InboundContext) error {
if natConn, isNatConn := conn.(udpnat.Conn); isNatConn {
metadata.Destination = M.Socksaddr{}
for _, packet := range packetBuffers {
@ -51,12 +51,10 @@ func (r *Router) hijackDNSPacket(ctx context.Context, conn N.PacketConn, packetB
conn: conn,
ctx: ctx,
metadata: metadata,
onClose: onClose,
})
return nil
}
err := dnsOutbound.NewDNSPacketConnection(ctx, r.dns, conn, packetBuffers, metadata)
N.CloseOnHandshakeFailure(conn, onClose, err)
if err != nil && !E.IsClosedOrCanceled(err) {
return E.Cause(err, "process DNS packet")
}
@ -95,16 +93,8 @@ type dnsHijacker struct {
conn N.PacketConn
ctx context.Context
metadata adapter.InboundContext
onClose N.CloseHandlerFunc
}
func (h *dnsHijacker) NewPacketEx(buffer *buf.Buffer, destination M.Socksaddr) {
go ExchangeDNSPacket(h.ctx, h.router, h.logger, h.conn, buffer, h.metadata, destination)
}
func (h *dnsHijacker) Close() error {
if h.onClose != nil {
h.onClose(nil)
}
return nil
}

View File

@ -117,8 +117,7 @@ func (r *Router) routeConnection(ctx context.Context, conn net.Conn, metadata ad
for _, buffer := range buffers {
conn = bufio.NewCachedConn(conn, buffer)
}
N.CloseOnHandshakeFailure(conn, onClose, r.hijackDNSStream(ctx, conn, metadata))
return nil
return r.hijackDNSStream(ctx, conn, metadata)
}
}
if selectedRule == nil {
@ -229,7 +228,8 @@ func (r *Router) routePacketConnection(ctx context.Context, conn N.PacketConn, m
N.ReleaseMultiPacketBuffer(packetBuffers)
return action.Error(ctx)
case *rule.RuleActionHijackDNS:
return r.hijackDNSPacket(ctx, conn, packetBuffers, metadata, onClose)
return r.hijackDNSPacket(ctx, conn, packetBuffers, metadata)
}
}
if selectedRule == nil || selectReturn {