Compare commits

..

62 Commits

Author SHA1 Message Date
世界
f70ca3d190
documentation: Bump version 2025-03-27 19:55:23 +08:00
dyhkwong
f16ab5e3df
Fix DNS over QUIC stream close 2025-03-27 19:25:27 +08:00
anytls
7ad655dec6
Update anytls
Co-authored-by: anytls <anytls>
2025-03-27 19:25:27 +08:00
Rambling2076
581b7a2a6d
Fix missing with_tailscale in Dockerfile
Signed-off-by: Rambling2076 <Rambling2076@proton.me>
2025-03-27 19:25:27 +08:00
世界
cebd6118fd
Fail when default DNS server not found 2025-03-27 19:25:27 +08:00
世界
a492586308
Update gVisor to 20250319.0 2025-03-27 19:25:27 +08:00
世界
2f27a9c307
release: Do not build tailscale on iOS and tvOS 2025-03-27 19:25:26 +08:00
世界
b710519728
Explicitly reject detour to empty direct outbounds 2025-03-27 19:25:25 +08:00
世界
acf433fb83
Ignore UDP offload error 2025-03-27 19:25:25 +08:00
世界
0071a4586a
Add netns support 2025-03-27 19:25:25 +08:00
世界
45ebaabcd7
Add wildcard name support for predefined records 2025-03-27 19:25:24 +08:00
世界
b2f456d6c5
Remove map usage in options 2025-03-27 19:25:24 +08:00
世界
08534c277e
Fix unhandled DNS loop 2025-03-27 19:25:23 +08:00
世界
bbd3b5b054
Add wildcard-sni support for shadow-tls inbound 2025-03-27 19:25:23 +08:00
世界
374647601d
Fix Tailscale DNS 2025-03-27 19:25:23 +08:00
k9982874
c934365929
Add ntp protocol sniffing 2025-03-27 19:25:23 +08:00
世界
f33287c50f
option: Fix marshal legacy DNS options 2025-03-27 19:25:22 +08:00
世界
477c1c32f8
Make domain_resolver optional when only one DNS server is configured 2025-03-27 19:25:22 +08:00
世界
4e01443a26
Fix DNS lookup context pollution 2025-03-27 19:25:21 +08:00
世界
d9e9a589db
Fix http3 DNS server connecting to wrong address 2025-03-27 19:25:21 +08:00
Restia-Ashbell
1339dcddce
documentation: Fix typo 2025-03-27 19:25:21 +08:00
anytls
84de755eb6
Update sing-anytls
Co-authored-by: anytls <anytls>
2025-03-27 19:25:21 +08:00
k9982874
7058c8e0d0
Fix hosts DNS server 2025-03-27 19:25:20 +08:00
世界
12b4205c3c
Fix UDP DNS server crash 2025-03-27 19:25:20 +08:00
世界
374eaa9301
documentation: Fix missing ip_accept_any DNS rule option 2025-03-27 19:25:20 +08:00
世界
9ddcd1c154
Fix anytls dialer usage 2025-03-27 19:25:20 +08:00
世界
7473db9515
Move predefined DNS server to rule action 2025-03-27 19:25:19 +08:00
世界
6d6789a4c5
Fix domain resolver on direct outbound 2025-03-27 19:25:19 +08:00
Zephyruso
f9d5927101
Fix missing AnyTLS display name 2025-03-27 19:25:19 +08:00
anytls
57c866c4d4
Update sing-anytls
Co-authored-by: anytls <anytls>
2025-03-27 19:25:18 +08:00
Estel
4d36ebe654
documentation: Fix typo
Signed-off-by: Estel <callmebedrockdigger@gmail.com>
2025-03-27 19:25:18 +08:00
TargetLocked
182c9adf00
Fix parsing legacy DNS options 2025-03-27 19:25:18 +08:00
世界
b43d8d2298
Fix DNS fallback 2025-03-27 19:25:17 +08:00
世界
f17b6fe703
documentation: Fix missing hosts DNS server 2025-03-27 19:25:17 +08:00
anytls
e2303234e8
Add MinIdleSession option to AnyTLS outbound
Co-authored-by: anytls <anytls>
2025-03-27 19:25:16 +08:00
ReleTor
96e4fe5125
documentation: Minor fixes 2025-03-27 19:25:16 +08:00
libtry486
f6fe6312bc
documentation: Fix typo
fix typo

Signed-off-by: libtry486 <89328481+libtry486@users.noreply.github.com>
2025-03-27 19:25:16 +08:00
Alireza Ahmadi
4c4d5e70c6
Fix Outbound deadlock 2025-03-27 19:25:16 +08:00
世界
d6f46598ff
documentation: Fix AnyTLS doc 2025-03-27 19:25:16 +08:00
anytls
78a7577575
Add AnyTLS protocol 2025-03-27 19:25:16 +08:00
世界
e56e6f9565
Migrate to stdlib ECH support 2025-03-27 19:25:15 +08:00
世界
6a4ae71992
Add fallback local DNS server for iOS 2025-03-27 19:25:15 +08:00
世界
fd97777f91
Get darwin local DNS server from libresolv 2025-03-27 19:25:15 +08:00
世界
13e9dc9cd6
Improve resolve action 2025-03-27 19:25:15 +08:00
世界
51b9d7fce1
Fix toolchain version 2025-03-27 19:25:15 +08:00
世界
3d37d37d38
Add back port hopping to hysteria 1 2025-03-27 19:25:14 +08:00
世界
f1fe1c5f4e
Update dependencies 2025-03-27 19:25:14 +08:00
xchacha20-poly1305
b830ef72e1
Remove single quotes of raw Moziila certs 2025-03-27 19:25:14 +08:00
世界
1ac3b3565f
Add Tailscale endpoint 2025-03-27 19:25:13 +08:00
世界
76d1f8cf5c
Build legacy binaries with latest Go 2025-03-27 19:25:13 +08:00
世界
70d64b0da1
documentation: Remove outdated icons 2025-03-27 19:25:13 +08:00
世界
d10dba568d
documentation: Certificate store 2025-03-27 19:25:12 +08:00
世界
2c6d0dba9e
documentation: TLS fragment 2025-03-27 19:25:12 +08:00
世界
dfd56bbcb3
documentation: Outbound domain resolver 2025-03-27 19:25:12 +08:00
世界
a7a3b4e2e1
documentation: Refactor DNS 2025-03-27 19:25:11 +08:00
世界
ed1ea104eb
Add certificate store 2025-03-27 19:25:10 +08:00
世界
511ba9bd6a
Add TLS fragment support 2025-03-27 19:25:10 +08:00
世界
ea442e0608
refactor: Outbound domain resolver 2025-03-27 19:25:10 +08:00
世界
86116b9423
refactor: DNS 2025-03-27 19:25:10 +08:00
世界
a530e424e9
Bump version 2025-03-27 18:17:39 +08:00
世界
0bfd487ee9
Fix udpnat2 handler again 2025-03-27 18:17:39 +08:00
世界
6aae834493
release: Fix workflow 2025-03-27 18:17:39 +08:00
10 changed files with 49 additions and 33 deletions

View File

@ -176,6 +176,9 @@ jobs:
PKG_NAME="sing-box_${{ needs.calculate_version.outputs.version }}_${{ matrix.os }}_${{ matrix.arch }}${ARM_VERSION}" PKG_NAME="sing-box_${{ needs.calculate_version.outputs.version }}_${{ matrix.os }}_${{ matrix.arch }}${ARM_VERSION}"
echo "DIR_NAME=${DIR_NAME}" >> "${GITHUB_ENV}" echo "DIR_NAME=${DIR_NAME}" >> "${GITHUB_ENV}"
echo "PKG_NAME=${PKG_NAME}" >> "${GITHUB_ENV}" echo "PKG_NAME=${PKG_NAME}" >> "${GITHUB_ENV}"
PKG_VERSION="${{ needs.calculate_version.outputs.version }}"
PKG_VERSION="${PKG_VERSION//-/\~}"
echo "PKG_VERSION=${PKG_VERSION}" >> "${GITHUB_ENV}"
- name: Package DEB - name: Package DEB
if: matrix.debian != '' if: matrix.debian != ''
run: | run: |
@ -183,7 +186,7 @@ jobs:
sudo gem install fpm sudo gem install fpm
sudo apt-get install -y debsigs sudo apt-get install -y debsigs
fpm -t deb \ fpm -t deb \
-v "${{ needs.calculate_version.outputs.version }}" \ -v "$PKG_VERSION" \
-p "dist/${PKG_NAME}.deb" \ -p "dist/${PKG_NAME}.deb" \
--architecture ${{ matrix.debian }} \ --architecture ${{ matrix.debian }} \
dist/sing-box=/usr/bin/sing-box dist/sing-box=/usr/bin/sing-box
@ -200,7 +203,7 @@ jobs:
set -xeuo pipefail set -xeuo pipefail
sudo gem install fpm sudo gem install fpm
fpm -t rpm \ fpm -t rpm \
-v "${{ needs.calculate_version.outputs.version }}" \ -v "$PKG_VERSION" \
-p "dist/${PKG_NAME}.rpm" \ -p "dist/${PKG_NAME}.rpm" \
--architecture ${{ matrix.rpm }} \ --architecture ${{ matrix.rpm }} \
dist/sing-box=/usr/bin/sing-box dist/sing-box=/usr/bin/sing-box
@ -219,7 +222,7 @@ jobs:
sudo gem install fpm sudo gem install fpm
sudo apt-get install -y libarchive-tools sudo apt-get install -y libarchive-tools
fpm -t pacman \ fpm -t pacman \
-v "${{ needs.calculate_version.outputs.version }}" \ -v "$PKG_VERSION" \
-p "dist/${PKG_NAME}.pkg.tar.zst" \ -p "dist/${PKG_NAME}.pkg.tar.zst" \
--architecture ${{ matrix.pacman }} \ --architecture ${{ matrix.pacman }} \
dist/sing-box=/usr/bin/sing-box dist/sing-box=/usr/bin/sing-box

View File

@ -109,6 +109,11 @@ jobs:
if: contains(needs.calculate_version.outputs.version, '-') if: contains(needs.calculate_version.outputs.version, '-')
run: |- run: |-
echo "NAME=sing-box-beta" >> "$GITHUB_ENV" echo "NAME=sing-box-beta" >> "$GITHUB_ENV"
- name: Set version
run: |-
PKG_VERSION="${{ needs.calculate_version.outputs.version }}"
PKG_VERSION="${PKG_VERSION//-/\~}"
echo "PKG_VERSION=${PKG_VERSION}" >> "${GITHUB_ENV}"
- name: Package DEB - name: Package DEB
if: matrix.debian != '' if: matrix.debian != ''
run: | run: |
@ -117,7 +122,7 @@ jobs:
sudo apt-get install -y debsigs sudo apt-get install -y debsigs
fpm -t deb \ fpm -t deb \
--name "${NAME}" \ --name "${NAME}" \
-v "${{ needs.calculate_version.outputs.version }}" \ -v "$PKG_VERSION" \
-p "dist/${NAME}_${{ needs.calculate_version.outputs.version }}_linux_${{ matrix.debian }}.deb" \ -p "dist/${NAME}_${{ needs.calculate_version.outputs.version }}_linux_${{ matrix.debian }}.deb" \
--architecture ${{ matrix.debian }} \ --architecture ${{ matrix.debian }} \
dist/sing-box=/usr/bin/sing-box dist/sing-box=/usr/bin/sing-box
@ -135,7 +140,7 @@ jobs:
sudo gem install fpm sudo gem install fpm
fpm -t rpm \ fpm -t rpm \
--name "${NAME}" \ --name "${NAME}" \
-v "${{ needs.calculate_version.outputs.version }}" \ -v "$PKG_VERSION" \
-p "dist/${NAME}_${{ needs.calculate_version.outputs.version }}_linux_${{ matrix.rpm }}.rpm" \ -p "dist/${NAME}_${{ needs.calculate_version.outputs.version }}_linux_${{ matrix.rpm }}.rpm" \
--architecture ${{ matrix.rpm }} \ --architecture ${{ matrix.rpm }} \
dist/sing-box=/usr/bin/sing-box dist/sing-box=/usr/bin/sing-box

@ -1 +1 @@
Subproject commit aefe3c029096ddac5189a20a8203a68858152f0a Subproject commit 5659088bb3fe18b7095e4b9f868c181e27739617

View File

@ -140,12 +140,12 @@ func (t *Transport) exchange(ctx context.Context, message *mDNS.Msg, conn quic.C
if err != nil { if err != nil {
return nil, err return nil, err
} }
defer stream.Close()
defer stream.CancelRead(0)
err = transport.WriteMessage(stream, 0, message) err = transport.WriteMessage(stream, 0, message)
if err != nil { if err != nil {
stream.Close()
return nil, err return nil, err
} }
stream.Close()
return transport.ReadMessage(stream) return transport.ReadMessage(stream)
} }

View File

@ -2,10 +2,16 @@
icon: material/alert-decagram icon: material/alert-decagram
--- ---
#### 1.12.0-alpha.20 #### 1.12.0-alpha.21
* Fixes and improvements * Fixes and improvements
### 1.11.6
* Fixes and improvements
_We are temporarily unable to update sing-box apps on the App Store because the reviewer mistakenly found that we violated the rules (TestFlight users are not affected)._
#### 1.12.0-alpha.19 #### 1.12.0-alpha.19
* Update gVisor to 20250319.0 * Update gVisor to 20250319.0

View File

@ -44,10 +44,10 @@ Default padding scheme:
``` ```
stop=8 stop=8
0=34-120 0=30-30
1=100-400 1=100-400
2=400-500,c,500-1000,c,400-500,c,500-1000,c,500-1000,c,400-500 2=400-500,c,500-1000,c,500-1000,c,500-1000,c,500-1000
3=500-1000 3=9-9,500-1000
4=500-1000 4=500-1000
5=500-1000 5=500-1000
6=500-1000 6=500-1000

View File

@ -44,10 +44,10 @@ AnyTLS 填充方案行数组。
``` ```
stop=8 stop=8
0=34-120 0=30-30
1=100-400 1=100-400
2=400-500,c,500-1000,c,400-500,c,500-1000,c,500-1000,c,400-500 2=400-500,c,500-1000,c,500-1000,c,500-1000,c,500-1000
3=500-1000 3=9-9,500-1000
4=500-1000 4=500-1000
5=500-1000 5=500-1000
6=500-1000 6=500-1000

2
go.mod
View File

@ -3,7 +3,7 @@ module github.com/sagernet/sing-box
go 1.23.1 go 1.23.1
require ( require (
github.com/anytls/sing-anytls v0.0.6 github.com/anytls/sing-anytls v0.0.7
github.com/caddyserver/certmagic v0.21.7 github.com/caddyserver/certmagic v0.21.7
github.com/cloudflare/circl v1.6.0 github.com/cloudflare/circl v1.6.0
github.com/cretz/bine v0.2.0 github.com/cretz/bine v0.2.0

4
go.sum
View File

@ -8,8 +8,8 @@ github.com/alexbrainman/sspi v0.0.0-20231016080023-1a75b4708caa h1:LHTHcTQiSGT7V
github.com/alexbrainman/sspi v0.0.0-20231016080023-1a75b4708caa/go.mod h1:cEWa1LVoE5KvSD9ONXsZrj0z6KqySlCCNKHlLzbqAt4= github.com/alexbrainman/sspi v0.0.0-20231016080023-1a75b4708caa/go.mod h1:cEWa1LVoE5KvSD9ONXsZrj0z6KqySlCCNKHlLzbqAt4=
github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M= github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M=
github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY=
github.com/anytls/sing-anytls v0.0.6 h1:UatIjl/OvzWQGXQ1I2bAIkabL9WtihW0fA7G+DXGBUg= github.com/anytls/sing-anytls v0.0.7 h1:0Q5dHNB2sqkFAWZCyK2vjQ/ckI5Iz3V/Frf3k7mBrGc=
github.com/anytls/sing-anytls v0.0.6/go.mod h1:7rjN6IukwysmdusYsrV51Fgu1uW6vsrdd6ctjnEAln8= github.com/anytls/sing-anytls v0.0.7/go.mod h1:7rjN6IukwysmdusYsrV51Fgu1uW6vsrdd6ctjnEAln8=
github.com/bits-and-blooms/bitset v1.13.0 h1:bAQ9OPNFYbGHV6Nez0tmNI0RiEu7/hxlYJRUA0wFAVE= github.com/bits-and-blooms/bitset v1.13.0 h1:bAQ9OPNFYbGHV6Nez0tmNI0RiEu7/hxlYJRUA0wFAVE=
github.com/bits-and-blooms/bitset v1.13.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/bits-and-blooms/bitset v1.13.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8=
github.com/caddyserver/certmagic v0.21.7 h1:66KJioPFJwttL43KYSWk7ErSmE6LfaJgCQuhm8Sg6fg= github.com/caddyserver/certmagic v0.21.7 h1:66KJioPFJwttL43KYSWk7ErSmE6LfaJgCQuhm8Sg6fg=

View File

@ -121,14 +121,6 @@ func (t *TProxy) NewPacketEx(buffer *buf.Buffer, oob []byte, source M.Socksaddr)
t.udpNat.NewPacket([][]byte{buffer.Bytes()}, source, M.SocksaddrFromNetIP(destination), nil) t.udpNat.NewPacket([][]byte{buffer.Bytes()}, source, M.SocksaddrFromNetIP(destination), nil)
} }
type tproxyPacketWriter struct {
ctx context.Context
listener *listener.Listener
source netip.AddrPort
destination M.Socksaddr
conn *net.UDPConn
}
func (t *TProxy) preparePacketConnection(source M.Socksaddr, destination M.Socksaddr, userData any) (bool, context.Context, N.PacketWriter, N.CloseHandlerFunc) { func (t *TProxy) preparePacketConnection(source M.Socksaddr, destination M.Socksaddr, userData any) (bool, context.Context, N.PacketWriter, N.CloseHandlerFunc) {
ctx := log.ContextWithNewID(t.ctx) ctx := log.ContextWithNewID(t.ctx)
writer := &tproxyPacketWriter{ writer := &tproxyPacketWriter{
@ -142,15 +134,25 @@ func (t *TProxy) preparePacketConnection(source M.Socksaddr, destination M.Socks
} }
} }
type tproxyPacketWriter struct {
ctx context.Context
listener *listener.Listener
source netip.AddrPort
destination M.Socksaddr
conn *net.UDPConn
}
func (w *tproxyPacketWriter) WritePacket(buffer *buf.Buffer, destination M.Socksaddr) error { func (w *tproxyPacketWriter) WritePacket(buffer *buf.Buffer, destination M.Socksaddr) error {
defer buffer.Release() defer buffer.Release()
conn := w.conn if w.listener.ListenOptions().NetNs == "" {
if w.destination == destination && conn != nil { conn := w.conn
_, err := conn.WriteToUDPAddrPort(buffer.Bytes(), w.source) if w.destination == destination && conn != nil {
if err != nil { _, err := conn.WriteToUDPAddrPort(buffer.Bytes(), w.source)
w.conn = nil if err != nil {
w.conn = nil
}
return err
} }
return err
} }
var listenConfig net.ListenConfig var listenConfig net.ListenConfig
listenConfig.Control = control.Append(listenConfig.Control, control.ReuseAddr()) listenConfig.Control = control.Append(listenConfig.Control, control.ReuseAddr())
@ -160,7 +162,7 @@ func (w *tproxyPacketWriter) WritePacket(buffer *buf.Buffer, destination M.Socks
return err return err
} }
udpConn := packetConn.(*net.UDPConn) udpConn := packetConn.(*net.UDPConn)
if w.destination == destination { if w.listener.ListenOptions().NetNs == "" && w.destination == destination {
w.conn = udpConn w.conn = udpConn
} else { } else {
defer udpConn.Close() defer udpConn.Close()