Compare commits

..

60 Commits

Author SHA1 Message Date
世界
4fe48c1a80
documentation: Bump version 2025-03-26 13:27:19 +08:00
Rambling2076
f5ac12870c
Fix missing with_tailscale in Dockerfile
Signed-off-by: Rambling2076 <Rambling2076@proton.me>
2025-03-26 13:27:05 +08:00
世界
5de57fad5d
Fail when default DNS server not found 2025-03-26 13:21:09 +08:00
世界
3c0fafb0a6
Update gVisor to 20250319.0 2025-03-26 13:21:09 +08:00
世界
7829e2677a
release: Do not build tailscale on iOS and tvOS 2025-03-26 13:21:08 +08:00
世界
24f918223f
Explicitly reject detour to empty direct outbounds 2025-03-26 13:21:08 +08:00
世界
3041ee9314
Ignore UDP offload error 2025-03-26 13:21:08 +08:00
世界
01d1a7f780
Add netns support 2025-03-26 13:21:08 +08:00
世界
349aecec92
Add wildcard name support for predefined records 2025-03-26 13:21:07 +08:00
世界
95cb46d943
Remove map usage in options 2025-03-26 13:21:07 +08:00
世界
2486fd39e4
Fix unhandled DNS loop 2025-03-26 13:21:07 +08:00
世界
d4b20ec36e
Add wildcard-sni support for shadow-tls inbound 2025-03-26 13:21:07 +08:00
世界
f04c976acb
Fix Tailscale DNS 2025-03-26 13:21:06 +08:00
k9982874
2994c59c58
Add ntp protocol sniffing 2025-03-26 13:21:06 +08:00
世界
2609a44115
option: Fix marshal legacy DNS options 2025-03-26 13:21:06 +08:00
世界
1c8d12b721
Make domain_resolver optional when only one DNS server is configured 2025-03-26 13:21:05 +08:00
世界
1ac69295c4
Fix DNS lookup context pollution 2025-03-26 13:21:05 +08:00
世界
57164832ad
Fix http3 DNS server connecting to wrong address 2025-03-26 13:21:05 +08:00
Restia-Ashbell
130dad1c54
documentation: Fix typo 2025-03-26 13:21:05 +08:00
anytls
8fea9c7ff2
Update sing-anytls
Co-authored-by: anytls <anytls>
2025-03-26 13:21:04 +08:00
k9982874
ca44711cc9
Fix hosts DNS server 2025-03-26 13:21:04 +08:00
世界
9195d1deec
Fix UDP DNS server crash 2025-03-26 13:21:04 +08:00
世界
2fccc5e806
documentation: Fix missing ip_accept_any DNS rule option 2025-03-26 13:21:03 +08:00
世界
157eb54c60
Fix anytls dialer usage 2025-03-26 13:21:03 +08:00
世界
1069b7d712
Move predefined DNS server to rule action 2025-03-26 13:21:03 +08:00
世界
d52322112e
Fix domain resolver on direct outbound 2025-03-26 13:21:02 +08:00
Zephyruso
59cbe0876e
Fix missing AnyTLS display name 2025-03-26 13:21:02 +08:00
anytls
864003dfd5
Update sing-anytls
Co-authored-by: anytls <anytls>
2025-03-26 13:21:02 +08:00
Estel
2cd746bb95
documentation: Fix typo
Signed-off-by: Estel <callmebedrockdigger@gmail.com>
2025-03-26 13:21:02 +08:00
TargetLocked
e3d5afa626
Fix parsing legacy DNS options 2025-03-26 13:21:02 +08:00
世界
e8d9560aa1
Fix DNS fallback 2025-03-26 13:21:01 +08:00
世界
d4fb0321c6
documentation: Fix missing hosts DNS server 2025-03-26 13:21:01 +08:00
anytls
e8c11439d9
Add MinIdleSession option to AnyTLS outbound
Co-authored-by: anytls <anytls>
2025-03-26 13:21:01 +08:00
ReleTor
342112b600
documentation: Minor fixes 2025-03-26 13:21:00 +08:00
libtry486
cf0bee8fe7
documentation: Fix typo
fix typo

Signed-off-by: libtry486 <89328481+libtry486@users.noreply.github.com>
2025-03-26 13:21:00 +08:00
Alireza Ahmadi
cebf8b3f3e
Fix Outbound deadlock 2025-03-26 13:21:00 +08:00
世界
3a5267b448
documentation: Fix AnyTLS doc 2025-03-26 13:21:00 +08:00
anytls
3e90cd4a8f
Add AnyTLS protocol 2025-03-26 13:20:59 +08:00
世界
42c769d375
Migrate to stdlib ECH support 2025-03-26 13:20:59 +08:00
世界
c8fea4d6fe
Add fallback local DNS server for iOS 2025-03-26 13:20:58 +08:00
世界
495bdee0aa
Get darwin local DNS server from libresolv 2025-03-26 13:20:58 +08:00
世界
20f245c628
Improve resolve action 2025-03-26 13:20:58 +08:00
世界
8cdb4b7c85
Fix toolchain version 2025-03-26 13:20:58 +08:00
世界
6b8307cf5d
Add back port hopping to hysteria 1 2025-03-26 13:20:58 +08:00
世界
b6d4fd4c39
Update dependencies 2025-03-26 13:20:57 +08:00
xchacha20-poly1305
0a052045bf
Remove single quotes of raw Moziila certs 2025-03-26 13:20:57 +08:00
世界
df588b84bc
Add Tailscale endpoint 2025-03-26 13:20:57 +08:00
世界
9c7e054d54
Build legacy binaries with latest Go 2025-03-26 13:20:56 +08:00
世界
28e01aed6d
documentation: Remove outdated icons 2025-03-26 13:20:56 +08:00
世界
d302b018ff
documentation: Certificate store 2025-03-26 13:20:55 +08:00
世界
925808dfd0
documentation: TLS fragment 2025-03-26 13:20:55 +08:00
世界
98ee3f467c
documentation: Outbound domain resolver 2025-03-26 13:20:55 +08:00
世界
14003c1981
documentation: Refactor DNS 2025-03-26 13:20:55 +08:00
世界
323d5887d6
Add certificate store 2025-03-26 13:20:55 +08:00
世界
766e3a1e8d
Add TLS fragment support 2025-03-26 13:20:33 +08:00
世界
291a4f1854
refactor: Outbound domain resolver 2025-03-26 13:19:46 +08:00
世界
dee381c45a
refactor: DNS 2025-03-26 13:19:20 +08:00
世界
95e397f898
Bump version 2025-03-26 13:14:08 +08:00
世界
ad1f3216fb
Fix udpnat2 handler again 2025-03-26 13:14:08 +08:00
世界
5b5e4903e2
release: Fix workflow 2025-03-26 13:14:08 +08:00
10 changed files with 33 additions and 49 deletions

View File

@ -176,9 +176,6 @@ 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: |
@ -186,7 +183,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 "$PKG_VERSION" \ -v "${{ needs.calculate_version.outputs.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
@ -203,7 +200,7 @@ jobs:
set -xeuo pipefail set -xeuo pipefail
sudo gem install fpm sudo gem install fpm
fpm -t rpm \ fpm -t rpm \
-v "$PKG_VERSION" \ -v "${{ needs.calculate_version.outputs.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
@ -222,7 +219,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 "$PKG_VERSION" \ -v "${{ needs.calculate_version.outputs.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,11 +109,6 @@ 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: |
@ -122,7 +117,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 "$PKG_VERSION" \ -v "${{ needs.calculate_version.outputs.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
@ -140,7 +135,7 @@ jobs:
sudo gem install fpm sudo gem install fpm
fpm -t rpm \ fpm -t rpm \
--name "${NAME}" \ --name "${NAME}" \
-v "$PKG_VERSION" \ -v "${{ needs.calculate_version.outputs.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 5659088bb3fe18b7095e4b9f868c181e27739617 Subproject commit aefe3c029096ddac5189a20a8203a68858152f0a

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,16 +2,10 @@
icon: material/alert-decagram icon: material/alert-decagram
--- ---
#### 1.12.0-alpha.21 #### 1.12.0-alpha.20
* 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=30-30 0=34-120
1=100-400 1=100-400
2=400-500,c,500-1000,c,500-1000,c,500-1000,c,500-1000 2=400-500,c,500-1000,c,400-500,c,500-1000,c,500-1000,c,400-500
3=9-9,500-1000 3=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=30-30 0=34-120
1=100-400 1=100-400
2=400-500,c,500-1000,c,500-1000,c,500-1000,c,500-1000 2=400-500,c,500-1000,c,400-500,c,500-1000,c,500-1000,c,400-500
3=9-9,500-1000 3=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.7 github.com/anytls/sing-anytls v0.0.6
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.7 h1:0Q5dHNB2sqkFAWZCyK2vjQ/ckI5Iz3V/Frf3k7mBrGc= github.com/anytls/sing-anytls v0.0.6 h1:UatIjl/OvzWQGXQ1I2bAIkabL9WtihW0fA7G+DXGBUg=
github.com/anytls/sing-anytls v0.0.7/go.mod h1:7rjN6IukwysmdusYsrV51Fgu1uW6vsrdd6ctjnEAln8= github.com/anytls/sing-anytls v0.0.6/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,6 +121,14 @@ 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{
@ -134,25 +142,15 @@ 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()
if w.listener.ListenOptions().NetNs == "" { conn := w.conn
conn := w.conn if w.destination == destination && conn != nil {
if w.destination == destination && conn != nil { _, err := conn.WriteToUDPAddrPort(buffer.Bytes(), w.source)
_, err := conn.WriteToUDPAddrPort(buffer.Bytes(), w.source) if err != nil {
if err != nil { w.conn = 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())
@ -162,7 +160,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.listener.ListenOptions().NetNs == "" && w.destination == destination { if w.destination == destination {
w.conn = udpConn w.conn = udpConn
} else { } else {
defer udpConn.Close() defer udpConn.Close()