Compare commits

..

118 Commits

Author SHA1 Message Date
renovate[bot]
1c62f8742e
[dependencies] Update golangci/golangci-lint-action action to v8 2025-07-03 14:22:41 +00:00
世界
989034b8f7
documentation: Bump version 2025-07-03 22:20:37 +08:00
世界
fef0a17bf8
release: Fix publish testflight 2025-07-03 21:49:38 +08:00
世界
c54f87e722
Improve darwin tun performance 2025-07-03 21:49:38 +08:00
世界
9bd9e5ab83
Improve nftables rules for openwrt 2025-07-03 21:49:37 +08:00
世界
7eb72226ab
Fixed DoH server recover from conn freezes 2025-07-03 21:49:37 +08:00
世界
1b08cdeb0a
Update libresolv usage 2025-07-03 21:49:37 +08:00
yu
88f989b934
documentation: Update client configuration manual 2025-07-03 21:49:36 +08:00
yanwo
65af6c7cdf
documentation: Fix typo
Signed-off-by: yanwo <ogilvy@gmail.com>
2025-07-03 21:49:36 +08:00
anytinz
7935126887
documentation: Fix wrong SideStore loopback ip 2025-07-03 21:49:36 +08:00
世界
1a78d3d28d
Revert "release: Add IPA build"
After testing, it seems that since extensions are not handled correctly, it cannot be installed by SideStore.
2025-07-03 21:49:36 +08:00
世界
0314c83afd
release: Add IPA build 2025-07-03 21:49:36 +08:00
世界
beb8741925
Add API to dump AdGuard rules 2025-07-03 21:49:35 +08:00
Sukka
74478e5f84
Improve AdGuard rule-set parser 2025-07-03 21:49:35 +08:00
Restia-Ashbell
82b9af7418
Add ECH support for uTLS 2025-07-03 21:49:35 +08:00
世界
3a5e6ee8fd
Improve TLS fragments 2025-07-03 21:49:34 +08:00
世界
cb20c6ec7f
Add cache support for ssm-api 2025-07-03 21:49:34 +08:00
世界
a5aef88073
Fix service will not be closed 2025-07-03 21:49:34 +08:00
世界
ab0af2960d
Add loopback address support for tun 2025-07-03 21:49:34 +08:00
世界
32a081d229
Fix tproxy listener 2025-07-03 21:49:33 +08:00
世界
6b7b1b2eac
Fix systemd package 2025-07-03 21:49:33 +08:00
世界
81364e3294
Fix missing home for derp service 2025-07-03 21:49:33 +08:00
Zero Clover
ee9474dd07
documentation: Fix services 2025-07-03 21:49:32 +08:00
世界
ec6b78d1b6
Fix dns.client_subnet ignored 2025-07-03 21:49:32 +08:00
世界
078fb5555d
documentation: Minor fixes 2025-07-03 21:49:32 +08:00
世界
99ea71119a
Fix tailscale forward 2025-07-03 21:49:31 +08:00
世界
d0ed53dae3
Minor fixes 2025-07-03 21:49:31 +08:00
世界
79deb889b1
Add SSM API service 2025-07-03 21:49:31 +08:00
世界
480d92901e
Add resolved service and DNS server 2025-07-03 21:49:30 +08:00
世界
3510a228e2
Add DERP service 2025-07-03 21:49:30 +08:00
世界
135e8e673f
Add service component type 2025-07-03 21:49:30 +08:00
世界
97fb38d8bf
Fix tproxy tcp control 2025-07-03 21:49:29 +08:00
愚者
f376bf834f
release: Fix build tags for android
Signed-off-by: 愚者 <11926619+FansChou@users.noreply.github.com>
2025-07-03 21:49:29 +08:00
世界
b9f53ec6cc
prevent creation of bind and mark controls on unsupported platforms 2025-07-03 21:49:29 +08:00
PuerNya
9208dd58c2
documentation: Fix description of reject DNS action behavior 2025-07-03 21:49:29 +08:00
Restia-Ashbell
c548a90f4a
Fix TLS record fragment 2025-07-03 21:49:28 +08:00
世界
e57e5f4415
Add missing accept_routes option for Tailscale 2025-07-03 21:49:28 +08:00
世界
63520226a0
Add TLS record fragment support 2025-07-03 21:49:28 +08:00
世界
02aeaca87a
Fix set edns0 client subnet 2025-07-03 21:49:27 +08:00
世界
c00373d930
Update minor dependencies 2025-07-03 21:49:27 +08:00
世界
db8ece9667
Update certmagic and providers 2025-07-03 21:49:27 +08:00
世界
763ca0c3f8
Update protobuf and grpc 2025-07-03 21:49:27 +08:00
世界
d641c152a7
Add control options for listeners 2025-07-03 21:49:26 +08:00
世界
5ccb67f1a5
Update quic-go to v0.52.0 2025-07-03 21:49:26 +08:00
世界
b763a2f178
Update utls to v1.7.2 2025-07-03 21:49:26 +08:00
世界
81a14bb5f2
Handle EDNS version downgrade 2025-07-03 21:49:25 +08:00
世界
5dbc9d2fc5
documentation: Fix anytls padding scheme description 2025-07-03 21:49:25 +08:00
安容
a35c4a6a96
Report invalid DNS address early 2025-07-03 21:49:25 +08:00
世界
ea2d355907
Fix wireguard listen_port 2025-07-03 21:49:24 +08:00
世界
ee58016702
clash-api: Add more meta api 2025-07-03 21:49:24 +08:00
世界
b1dc45898b
Fix DNS lookup 2025-07-03 21:49:24 +08:00
世界
f51c2a4e66
Fix fetch ECH configs 2025-07-03 21:49:24 +08:00
reletor
3cd42b6d37
documentation: Minor fixes 2025-07-03 21:49:23 +08:00
caelansar
9494f2ae21
Fix callback deletion in UDP transport 2025-07-03 21:49:23 +08:00
世界
23c24cace8
documentation: Try to make the play review happy 2025-07-03 21:49:23 +08:00
世界
e225a6476e
Fix missing handling of legacy domain_strategy options 2025-07-03 21:49:23 +08:00
世界
53ea9cb4c7
Improve local DNS server 2025-07-03 21:49:22 +08:00
anytls
7b5eef8ae2
Update anytls
Co-authored-by: anytls <anytls>
2025-07-03 21:49:22 +08:00
世界
ffa70c0288
Fix DNS dialer 2025-07-03 21:49:21 +08:00
世界
1cb605924a
release: Skip override version for iOS 2025-07-03 21:49:21 +08:00
iikira
90320bc80d
Fix UDP DNS server crash
Signed-off-by: iikira <i2@mail.iikira.com>
2025-07-03 21:49:21 +08:00
ReleTor
b4402e27d9
Fix fetch ECH configs 2025-07-03 21:49:20 +08:00
世界
14bcf34f86
Allow direct outbounds without domain_resolver 2025-07-03 21:49:20 +08:00
世界
e41cb6d559
Fix Tailscale dialer 2025-07-03 21:49:20 +08:00
dyhkwong
d90dec5381
Fix DNS over QUIC stream close 2025-07-03 21:49:20 +08:00
anytls
e09aa7ca84
Update anytls
Co-authored-by: anytls <anytls>
2025-07-03 21:49:20 +08:00
Rambling2076
832d37b808
Fix missing with_tailscale in Dockerfile
Signed-off-by: Rambling2076 <Rambling2076@proton.me>
2025-07-03 21:49:19 +08:00
世界
3a70ae7afe
Fail when default DNS server not found 2025-07-03 21:49:19 +08:00
世界
cf1058de4c
Update gVisor to 20250319.0 2025-07-03 21:49:19 +08:00
世界
73e6bbb49a
Explicitly reject detour to empty direct outbounds 2025-07-03 21:49:18 +08:00
世界
329d4bb4c9
Add netns support 2025-07-03 21:49:18 +08:00
世界
b43615ef35
Add wildcard name support for predefined records 2025-07-03 21:49:18 +08:00
世界
e7479dea90
Remove map usage in options 2025-07-03 21:49:17 +08:00
世界
f1f1406eb1
Fix unhandled DNS loop 2025-07-03 21:49:17 +08:00
世界
fe9cc7461b
Add wildcard-sni support for shadow-tls inbound 2025-07-03 21:49:17 +08:00
k9982874
710ca243aa
Add ntp protocol sniffing 2025-07-03 21:49:16 +08:00
世界
a249770e24
option: Fix marshal legacy DNS options 2025-07-03 21:49:16 +08:00
世界
6d2bd2116b
Make domain_resolver optional when only one DNS server is configured 2025-07-03 21:49:16 +08:00
世界
2e1698fa78
Fix DNS lookup context pollution 2025-07-03 21:49:16 +08:00
世界
6946ec37cf
Fix http3 DNS server connecting to wrong address 2025-07-03 21:49:15 +08:00
Restia-Ashbell
25f844ec6d
documentation: Fix typo 2025-07-03 21:49:15 +08:00
anytls
5a5c906fb2
Update sing-anytls
Co-authored-by: anytls <anytls>
2025-07-03 21:49:15 +08:00
k9982874
31c191debb
Fix hosts DNS server 2025-07-03 21:49:15 +08:00
世界
1b02fca33f
Fix UDP DNS server crash 2025-07-03 21:49:14 +08:00
世界
5308c46e07
documentation: Fix missing ip_accept_any DNS rule option 2025-07-03 21:49:14 +08:00
世界
0cfcaf2c62
Fix anytls dialer usage 2025-07-03 21:49:14 +08:00
世界
a2bd384c32
Move predefined DNS server to rule action 2025-07-03 21:49:13 +08:00
世界
3723dd2583
Fix domain resolver on direct outbound 2025-07-03 21:49:13 +08:00
Zephyruso
9bbc3dabc8
Fix missing AnyTLS display name 2025-07-03 21:49:13 +08:00
anytls
6827d67a09
Update sing-anytls
Co-authored-by: anytls <anytls>
2025-07-03 21:49:13 +08:00
Estel
5ae3e97388
documentation: Fix typo
Signed-off-by: Estel <callmebedrockdigger@gmail.com>
2025-07-03 21:49:13 +08:00
TargetLocked
f6d1099b69
Fix parsing legacy DNS options 2025-07-03 21:49:12 +08:00
世界
ca1b5bbcdf
Fix DNS fallback 2025-07-03 21:49:12 +08:00
世界
1c6c48ea8d
documentation: Fix missing hosts DNS server 2025-07-03 21:49:11 +08:00
anytls
0d86d225a3
Add MinIdleSession option to AnyTLS outbound
Co-authored-by: anytls <anytls>
2025-07-03 21:49:11 +08:00
ReleTor
b75e6b88b7
documentation: Minor fixes 2025-07-03 21:49:11 +08:00
libtry486
000f7b1045
documentation: Fix typo
fix typo

Signed-off-by: libtry486 <89328481+libtry486@users.noreply.github.com>
2025-07-03 21:49:11 +08:00
Alireza Ahmadi
b39204f4aa
Fix Outbound deadlock 2025-07-03 21:49:10 +08:00
世界
2b2655ffc7
documentation: Fix AnyTLS doc 2025-07-03 21:49:10 +08:00
anytls
3f9f41caed
Add AnyTLS protocol 2025-07-03 21:49:10 +08:00
世界
0231e3c575
Migrate to stdlib ECH support 2025-07-03 21:49:09 +08:00
世界
918b70b1cc
Add fallback local DNS server for iOS 2025-07-03 21:49:09 +08:00
世界
af4c4d1841
Get darwin local DNS server from libresolv 2025-07-03 21:49:09 +08:00
世界
88e830b5d8
Improve resolve action 2025-07-03 21:49:08 +08:00
世界
7eb14cfe9f
Add back port hopping to hysteria 1 2025-07-03 21:49:08 +08:00
xchacha20-poly1305
e6761fa538
Remove single quotes of raw Moziila certs 2025-07-03 21:49:08 +08:00
世界
485d28ceec
Add Tailscale endpoint 2025-07-03 21:49:07 +08:00
世界
159a2858e2
Build legacy binaries with latest Go 2025-07-03 21:49:07 +08:00
世界
b6691707e9
documentation: Remove outdated icons 2025-07-03 21:49:07 +08:00
世界
38f1736f78
documentation: Certificate store 2025-07-03 21:49:06 +08:00
世界
ff77bf63f5
documentation: TLS fragment 2025-07-03 21:49:06 +08:00
世界
9dad482e70
documentation: Outbound domain resolver 2025-07-03 21:49:06 +08:00
世界
d43791307c
documentation: Refactor DNS 2025-07-03 21:49:05 +08:00
世界
0a82b8a9ad
Add certificate store 2025-07-03 21:49:05 +08:00
世界
7bf91fb2af
Add TLS fragment support 2025-07-03 21:49:05 +08:00
世界
81d2eb5f3f
refactor: Outbound domain resolver 2025-07-03 21:49:05 +08:00
世界
ee731a32c8
refactor: DNS 2025-07-03 21:49:04 +08:00
世界
6f804adf39
Fix v2rayhttp crash 2025-07-03 21:48:10 +08:00
8 changed files with 34 additions and 21 deletions

View File

@ -245,8 +245,8 @@ lib:
go run ./cmd/internal/build_libbox -target ios go run ./cmd/internal/build_libbox -target ios
lib_install: lib_install:
go install -v github.com/sagernet/gomobile/cmd/gomobile@v0.1.6 go install -v github.com/sagernet/gomobile/cmd/gomobile@v0.1.7
go install -v github.com/sagernet/gomobile/cmd/gobind@v0.1.6 go install -v github.com/sagernet/gomobile/cmd/gobind@v0.1.7
docs: docs:
venv/bin/mkdocs serve venv/bin/mkdocs serve

View File

@ -177,7 +177,7 @@ func publishTestflight(ctx context.Context) error {
} }
log.Info(string(platform), " ", tag, " publish") log.Info(string(platform), " ", tag, " publish")
response, err := client.TestFlight.AddBuildsToBetaGroup(ctx, groupID, []string{build.ID}) response, err := client.TestFlight.AddBuildsToBetaGroup(ctx, groupID, []string{build.ID})
if response != nil && response.StatusCode == http.StatusUnprocessableEntity { if response != nil && (response.StatusCode == http.StatusUnprocessableEntity || response.StatusCode == http.StatusNotFound) {
log.Info("waiting for process") log.Info("waiting for process")
time.Sleep(15 * time.Second) time.Sleep(15 * time.Second)
continue continue

View File

@ -46,8 +46,9 @@ var (
sharedFlags []string sharedFlags []string
debugFlags []string debugFlags []string
sharedTags []string sharedTags []string
iosTags []string darwinTags []string
memcTags []string memcTags []string
notMemcTags []string
debugTags []string debugTags []string
) )
@ -62,8 +63,9 @@ func init() {
debugFlags = append(debugFlags, "-ldflags", "-X github.com/sagernet/sing-box/constant.Version="+currentTag) debugFlags = append(debugFlags, "-ldflags", "-X github.com/sagernet/sing-box/constant.Version="+currentTag)
sharedTags = append(sharedTags, "with_gvisor", "with_quic", "with_wireguard", "with_utls", "with_clash_api", "with_conntrack") sharedTags = append(sharedTags, "with_gvisor", "with_quic", "with_wireguard", "with_utls", "with_clash_api", "with_conntrack")
iosTags = append(iosTags, "with_dhcp", "with_low_memory") darwinTags = append(darwinTags, "with_dhcp")
memcTags = append(memcTags, "with_tailscale") memcTags = append(memcTags, "with_tailscale")
notMemcTags = append(notMemcTags, "with_low_memory")
debugTags = append(debugTags, "debug") debugTags = append(debugTags, "debug")
} }
@ -153,6 +155,7 @@ func buildApple() {
"-v", "-v",
"-target", bindTarget, "-target", bindTarget,
"-libname=box", "-libname=box",
"-tags-not-macos=with_low_memory",
} }
if !withTailscale { if !withTailscale {
args = append(args, "-tags-macos="+strings.Join(memcTags, ",")) args = append(args, "-tags-macos="+strings.Join(memcTags, ","))
@ -164,7 +167,7 @@ func buildApple() {
args = append(args, debugFlags...) args = append(args, debugFlags...)
} }
tags := append(sharedTags, iosTags...) tags := append(sharedTags, darwinTags...)
if withTailscale { if withTailscale {
tags = append(tags, memcTags...) tags = append(tags, memcTags...)
} }

View File

@ -2,10 +2,15 @@
icon: material/alert-decagram icon: material/alert-decagram
--- ---
#### 1.12.0-beta.30 #### 1.12.0-beta.31
* Improve tun performance on Apple platforms **1**
* Fixes and improvements * Fixes and improvements
**1**:
We have significantly improved the performance of tun inbound on Apple platforms, especially in the gVisor stack.
### 1.11.14 ### 1.11.14
* Fixes and improvements * Fixes and improvements

6
go.mod
View File

@ -25,16 +25,16 @@ require (
github.com/sagernet/bbolt v0.0.0-20231014093535-ea5cb2fe9f0a github.com/sagernet/bbolt v0.0.0-20231014093535-ea5cb2fe9f0a
github.com/sagernet/cors v1.2.1 github.com/sagernet/cors v1.2.1
github.com/sagernet/fswatch v0.1.1 github.com/sagernet/fswatch v0.1.1
github.com/sagernet/gomobile v0.1.6 github.com/sagernet/gomobile v0.1.7
github.com/sagernet/gvisor v0.0.0-20250325023245-7a9c0f5725fb github.com/sagernet/gvisor v0.0.0-20250325023245-7a9c0f5725fb
github.com/sagernet/quic-go v0.52.0-beta.1 github.com/sagernet/quic-go v0.52.0-beta.1
github.com/sagernet/sing v0.6.11-0.20250521033217-30d675ea099b github.com/sagernet/sing v0.6.12-0.20250703120903-7081a0c40539
github.com/sagernet/sing-mux v0.3.2 github.com/sagernet/sing-mux v0.3.2
github.com/sagernet/sing-quic v0.5.0-beta.2 github.com/sagernet/sing-quic v0.5.0-beta.2
github.com/sagernet/sing-shadowsocks v0.2.8 github.com/sagernet/sing-shadowsocks v0.2.8
github.com/sagernet/sing-shadowsocks2 v0.2.1 github.com/sagernet/sing-shadowsocks2 v0.2.1
github.com/sagernet/sing-shadowtls v0.2.1-0.20250503051639-fcd445d33c11 github.com/sagernet/sing-shadowtls v0.2.1-0.20250503051639-fcd445d33c11
github.com/sagernet/sing-tun v0.6.10-0.20250630100036-8763c24e4935 github.com/sagernet/sing-tun v0.6.10-0.20250703121732-a0881ada3251
github.com/sagernet/sing-vmess v0.2.4-0.20250605032146-38cc72672c88 github.com/sagernet/sing-vmess v0.2.4-0.20250605032146-38cc72672c88
github.com/sagernet/smux v1.5.34-mod.2 github.com/sagernet/smux v1.5.34-mod.2
github.com/sagernet/tailscale v1.80.3-mod.5 github.com/sagernet/tailscale v1.80.3-mod.5

12
go.sum
View File

@ -157,8 +157,8 @@ github.com/sagernet/cors v1.2.1 h1:Cv5Z8y9YSD6Gm+qSpNrL3LO4lD3eQVvbFYJSG7JCMHQ=
github.com/sagernet/cors v1.2.1/go.mod h1:O64VyOjjhrkLmQIjF4KGRrJO/5dVXFdpEmCW/eISRAI= github.com/sagernet/cors v1.2.1/go.mod h1:O64VyOjjhrkLmQIjF4KGRrJO/5dVXFdpEmCW/eISRAI=
github.com/sagernet/fswatch v0.1.1 h1:YqID+93B7VRfqIH3PArW/XpJv5H4OLEVWDfProGoRQs= github.com/sagernet/fswatch v0.1.1 h1:YqID+93B7VRfqIH3PArW/XpJv5H4OLEVWDfProGoRQs=
github.com/sagernet/fswatch v0.1.1/go.mod h1:nz85laH0mkQqJfaOrqPpkwtU1znMFNVTpT/5oRsVz/o= github.com/sagernet/fswatch v0.1.1/go.mod h1:nz85laH0mkQqJfaOrqPpkwtU1znMFNVTpT/5oRsVz/o=
github.com/sagernet/gomobile v0.1.6 h1:JkR1ToKOrdoiwULte4pYS5HYdPBzl2N+JNuuwVuLs0k= github.com/sagernet/gomobile v0.1.7 h1:I9jCJZTH0weP5MsuydvYHX5QfN/r6Fe8ptAIj1+SJVg=
github.com/sagernet/gomobile v0.1.6/go.mod h1:Pqq2+ZVvs10U7xK+UwJgwYWUykewi8H6vlslAO73n9E= github.com/sagernet/gomobile v0.1.7/go.mod h1:Pqq2+ZVvs10U7xK+UwJgwYWUykewi8H6vlslAO73n9E=
github.com/sagernet/gvisor v0.0.0-20250325023245-7a9c0f5725fb h1:pprQtDqNgqXkRsXn+0E8ikKOemzmum8bODjSfDene38= github.com/sagernet/gvisor v0.0.0-20250325023245-7a9c0f5725fb h1:pprQtDqNgqXkRsXn+0E8ikKOemzmum8bODjSfDene38=
github.com/sagernet/gvisor v0.0.0-20250325023245-7a9c0f5725fb/go.mod h1:QkkPEJLw59/tfxgapHta14UL5qMUah5NXhO0Kw2Kan4= github.com/sagernet/gvisor v0.0.0-20250325023245-7a9c0f5725fb/go.mod h1:QkkPEJLw59/tfxgapHta14UL5qMUah5NXhO0Kw2Kan4=
github.com/sagernet/netlink v0.0.0-20240612041022-b9a21c07ac6a h1:ObwtHN2VpqE0ZNjr6sGeT00J8uU7JF4cNUdb44/Duis= github.com/sagernet/netlink v0.0.0-20240612041022-b9a21c07ac6a h1:ObwtHN2VpqE0ZNjr6sGeT00J8uU7JF4cNUdb44/Duis=
@ -168,8 +168,8 @@ github.com/sagernet/nftables v0.3.0-beta.4/go.mod h1:OQXAjvjNGGFxaTgVCSTRIhYB5/l
github.com/sagernet/quic-go v0.52.0-beta.1 h1:hWkojLg64zjV+MJOvJU/kOeWndm3tiEfBLx5foisszs= github.com/sagernet/quic-go v0.52.0-beta.1 h1:hWkojLg64zjV+MJOvJU/kOeWndm3tiEfBLx5foisszs=
github.com/sagernet/quic-go v0.52.0-beta.1/go.mod h1:OV+V5kEBb8kJS7k29MzDu6oj9GyMc7HA07sE1tedxz4= github.com/sagernet/quic-go v0.52.0-beta.1/go.mod h1:OV+V5kEBb8kJS7k29MzDu6oj9GyMc7HA07sE1tedxz4=
github.com/sagernet/sing v0.6.9/go.mod h1:ARkL0gM13/Iv5VCZmci/NuoOlePoIsW0m7BWfln/Hak= github.com/sagernet/sing v0.6.9/go.mod h1:ARkL0gM13/Iv5VCZmci/NuoOlePoIsW0m7BWfln/Hak=
github.com/sagernet/sing v0.6.11-0.20250521033217-30d675ea099b h1:ZjTCYPb5f7aHdf1UpUvE22dVmf7BL8eQ/zLZhjgh7Wo= github.com/sagernet/sing v0.6.12-0.20250703120903-7081a0c40539 h1:SK4M4FCNdwV4EiYKIUZ9qM4lr/1NQogJe1YoyYw5DV8=
github.com/sagernet/sing v0.6.11-0.20250521033217-30d675ea099b/go.mod h1:ARkL0gM13/Iv5VCZmci/NuoOlePoIsW0m7BWfln/Hak= github.com/sagernet/sing v0.6.12-0.20250703120903-7081a0c40539/go.mod h1:ARkL0gM13/Iv5VCZmci/NuoOlePoIsW0m7BWfln/Hak=
github.com/sagernet/sing-mux v0.3.2 h1:meZVFiiStvHThb/trcpAkCrmtJOuItG5Dzl1RRP5/NE= github.com/sagernet/sing-mux v0.3.2 h1:meZVFiiStvHThb/trcpAkCrmtJOuItG5Dzl1RRP5/NE=
github.com/sagernet/sing-mux v0.3.2/go.mod h1:pht8iFY4c9Xltj7rhVd208npkNaeCxzyXCgulDPLUDA= github.com/sagernet/sing-mux v0.3.2/go.mod h1:pht8iFY4c9Xltj7rhVd208npkNaeCxzyXCgulDPLUDA=
github.com/sagernet/sing-quic v0.5.0-beta.2 h1:j7KAbBuGmsKwSxVAQL5soJ+wDqxim4/llK2kxB0hSKk= github.com/sagernet/sing-quic v0.5.0-beta.2 h1:j7KAbBuGmsKwSxVAQL5soJ+wDqxim4/llK2kxB0hSKk=
@ -180,8 +180,8 @@ github.com/sagernet/sing-shadowsocks2 v0.2.1 h1:dWV9OXCeFPuYGHb6IRqlSptVnSzOelnq
github.com/sagernet/sing-shadowsocks2 v0.2.1/go.mod h1:RnXS0lExcDAovvDeniJ4IKa2IuChrdipolPYWBv9hWQ= github.com/sagernet/sing-shadowsocks2 v0.2.1/go.mod h1:RnXS0lExcDAovvDeniJ4IKa2IuChrdipolPYWBv9hWQ=
github.com/sagernet/sing-shadowtls v0.2.1-0.20250503051639-fcd445d33c11 h1:tK+75l64tm9WvEFrYRE1t0YxoFdWQqw/h7Uhzj0vJ+w= github.com/sagernet/sing-shadowtls v0.2.1-0.20250503051639-fcd445d33c11 h1:tK+75l64tm9WvEFrYRE1t0YxoFdWQqw/h7Uhzj0vJ+w=
github.com/sagernet/sing-shadowtls v0.2.1-0.20250503051639-fcd445d33c11/go.mod h1:sWqKnGlMipCHaGsw1sTTlimyUpgzP4WP3pjhCsYt9oA= github.com/sagernet/sing-shadowtls v0.2.1-0.20250503051639-fcd445d33c11/go.mod h1:sWqKnGlMipCHaGsw1sTTlimyUpgzP4WP3pjhCsYt9oA=
github.com/sagernet/sing-tun v0.6.10-0.20250630100036-8763c24e4935 h1:wha4BG4mrEKaIoouVyiU5BcPfKD1n0LkiL4vqdjaVps= github.com/sagernet/sing-tun v0.6.10-0.20250703121732-a0881ada3251 h1:eH9naJXvyF/DZDk0V1SYkL6ypYD+A1tUFWLcT7PRezg=
github.com/sagernet/sing-tun v0.6.10-0.20250630100036-8763c24e4935/go.mod h1:fisFCbC4Vfb6HqQNcwPJi2CDK2bf0Xapyz3j3t4cnHE= github.com/sagernet/sing-tun v0.6.10-0.20250703121732-a0881ada3251/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 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.20250605032146-38cc72672c88/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 h1:gkmBjIjlJ2zQKpLigOkFur5kBKdV6bNRoFu2WkltRQ4=

View File

@ -130,10 +130,15 @@ func NewInbound(ctx context.Context, router adapter.Router, logger log.ContextLo
deprecated.Report(ctx, deprecated.OptionTUNGSO) deprecated.Report(ctx, deprecated.OptionTUNGSO)
} }
platformInterface := service.FromContext[platform.Interface](ctx)
tunMTU := options.MTU tunMTU := options.MTU
if tunMTU == 0 { if tunMTU == 0 {
if platformInterface != nil && platformInterface.UnderNetworkExtension() {
tunMTU = 4000
} else {
tunMTU = 9000 tunMTU = 9000
} }
}
var udpTimeout time.Duration var udpTimeout time.Duration
if options.UDPTimeout != 0 { if options.UDPTimeout != 0 {
udpTimeout = time.Duration(options.UDPTimeout) udpTimeout = time.Duration(options.UDPTimeout)
@ -208,7 +213,7 @@ func NewInbound(ctx context.Context, router adapter.Router, logger log.ContextLo
}, },
udpTimeout: udpTimeout, udpTimeout: udpTimeout,
stack: options.Stack, stack: options.Stack,
platformInterface: service.FromContext[platform.Interface](ctx), platformInterface: platformInterface,
platformOptions: common.PtrValueOrDefault(options.Platform), platformOptions: common.PtrValueOrDefault(options.Platform),
} }
for _, routeAddressSet := range options.RouteAddressSet { for _, routeAddressSet := range options.RouteAddressSet {

View File

@ -31,6 +31,9 @@ type HTTPConn struct {
} }
func NewHTTP1Conn(conn net.Conn, request *http.Request) *HTTPConn { func NewHTTP1Conn(conn net.Conn, request *http.Request) *HTTPConn {
if request.Header.Get("Host") == "" {
request.Header.Set("Host", request.Host)
}
return &HTTPConn{ return &HTTPConn{
Conn: conn, Conn: conn,
request: request, request: request,
@ -89,9 +92,6 @@ func (c *HTTPConn) writeRequest(payload []byte) error {
if err != nil { if err != nil {
return err return err
} }
if c.request.Header.Get("Host") == "" {
c.request.Header.Set("Host", c.request.Host)
}
for key, value := range c.request.Header { for key, value := range c.request.Header {
_, err = writer.Write([]byte(F.ToString(key, ": ", strings.Join(value, ", "), CRLF))) _, err = writer.Write([]byte(F.ToString(key, ": ", strings.Join(value, ", "), CRLF)))
if err != nil { if err != nil {