Compare commits

..

112 Commits

Author SHA1 Message Date
renovate[bot]
b7a622cac0
[dependencies] Update golangci/golangci-lint-action action to v8 2025-06-21 10:09:00 +00:00
世界
a7d14d4044
documentation: Bump version 2025-06-21 18:07:33 +08:00
世界
8802c88243
documentation: Add link to IPAs 2025-06-21 18:07:33 +08:00
anytinz
182d85269d
documentation: Fix wrong SideStore loopback ip 2025-06-21 18:07:33 +08:00
世界
1da72a6532
release: Add IPA build 2025-06-21 18:07:32 +08:00
世界
16e05be1be
Add API to dump AdGuard rules 2025-06-21 18:07:32 +08:00
Sukka
259a140453
Improve AdGuard rule-set parser 2025-06-21 18:07:32 +08:00
Restia-Ashbell
54760eeaaa
Add ECH support for uTLS 2025-06-21 18:07:31 +08:00
世界
a870c36d2d
Improve TLS fragments 2025-06-21 18:07:31 +08:00
世界
1054f58751
Add cache support for ssm-api 2025-06-21 18:07:30 +08:00
世界
6981dfe0c0
Fix service will not be closed 2025-06-21 18:07:30 +08:00
世界
719d0d3c31
Add loopback address support for tun 2025-06-21 18:07:29 +08:00
世界
8f5fad3f9d
Fix tproxy listener 2025-06-21 18:07:29 +08:00
世界
c2e9c30efc
Fix systemd package 2025-06-21 18:07:28 +08:00
世界
3da06f0db8
Fix missing home for derp service 2025-06-21 18:07:28 +08:00
Zero Clover
acb5065198
documentation: Fix services 2025-06-21 18:07:28 +08:00
世界
c6a7d8c587
Fix dns.client_subnet ignored 2025-06-21 18:07:27 +08:00
世界
a9ff1cbf78
documentation: Minor fixes 2025-06-21 18:07:27 +08:00
世界
94e0d6b4ab
Fix tailscale forward 2025-06-21 18:07:26 +08:00
世界
93c866a900
Minor fixes 2025-06-21 18:07:26 +08:00
世界
40451f8957
Add SSM API service 2025-06-21 18:07:26 +08:00
世界
2a2ca1bef6
Add resolved service and DNS server 2025-06-21 18:07:25 +08:00
世界
e156abb0ab
Add DERP service 2025-06-21 18:07:25 +08:00
世界
94d70a2a97
Add service component type 2025-06-21 18:07:24 +08:00
世界
4b2cda1c76
Fix tproxy tcp control 2025-06-21 18:07:24 +08:00
愚者
6e8e007352
release: Fix build tags for android
Signed-off-by: 愚者 <11926619+FansChou@users.noreply.github.com>
2025-06-21 18:07:23 +08:00
世界
d18a35c414
prevent creation of bind and mark controls on unsupported platforms 2025-06-21 18:07:23 +08:00
PuerNya
ea31ebb2a3
documentation: Fix description of reject DNS action behavior 2025-06-21 18:07:22 +08:00
Restia-Ashbell
0951711c08
Fix TLS record fragment 2025-06-21 18:07:22 +08:00
世界
fdd8d3e23e
Add missing accept_routes option for Tailscale 2025-06-21 18:07:22 +08:00
世界
53feae6a6e
Add TLS record fragment support 2025-06-21 18:07:21 +08:00
世界
b63eba13ef
Fix set edns0 client subnet 2025-06-21 18:07:21 +08:00
世界
a2c52fb21b
Update minor dependencies 2025-06-21 18:07:21 +08:00
世界
01d06c0d29
Update certmagic and providers 2025-06-21 18:07:20 +08:00
世界
01b11f3d4e
Update protobuf and grpc 2025-06-21 18:07:20 +08:00
世界
567c98dc9e
Add control options for listeners 2025-06-21 18:07:19 +08:00
世界
f8a64a6554
Update quic-go to v0.52.0 2025-06-21 18:07:19 +08:00
世界
5dd021e979
Update utls to v1.7.2 2025-06-21 18:07:19 +08:00
世界
a3f9196fdc
Handle EDNS version downgrade 2025-06-21 18:07:18 +08:00
世界
42102b3fc4
documentation: Fix anytls padding scheme description 2025-06-21 18:07:18 +08:00
安容
c0e5fe78ab
Report invalid DNS address early 2025-06-21 18:07:17 +08:00
世界
ad7bb47bf6
Fix wireguard listen_port 2025-06-21 18:07:17 +08:00
世界
58779f99ce
clash-api: Add more meta api 2025-06-21 18:07:16 +08:00
世界
b14782771b
Fix DNS lookup 2025-06-21 18:07:16 +08:00
世界
51816e0cd2
Fix fetch ECH configs 2025-06-21 18:07:16 +08:00
reletor
0b7ea0c6c6
documentation: Minor fixes 2025-06-21 18:07:16 +08:00
caelansar
cac33150d8
Fix callback deletion in UDP transport 2025-06-21 18:07:16 +08:00
世界
31bd6bb5cb
documentation: Try to make the play review happy 2025-06-21 18:07:15 +08:00
世界
7f26d21a28
Fix missing handling of legacy domain_strategy options 2025-06-21 18:07:15 +08:00
世界
14a8e87e2f
Improve local DNS server 2025-06-21 18:07:15 +08:00
anytls
38e3766c33
Update anytls
Co-authored-by: anytls <anytls>
2025-06-21 18:07:14 +08:00
世界
1be391470a
Fix DNS dialer 2025-06-21 18:07:13 +08:00
世界
560f567881
release: Skip override version for iOS 2025-06-21 18:07:13 +08:00
iikira
53dfdd1ec6
Fix UDP DNS server crash
Signed-off-by: iikira <i2@mail.iikira.com>
2025-06-21 18:07:13 +08:00
ReleTor
69fe3b16f1
Fix fetch ECH configs 2025-06-21 18:07:13 +08:00
世界
85d80deec8
Allow direct outbounds without domain_resolver 2025-06-21 18:07:12 +08:00
世界
2570b11ea4
Fix Tailscale dialer 2025-06-21 18:07:12 +08:00
dyhkwong
d4d1ea7129
Fix DNS over QUIC stream close 2025-06-21 18:07:12 +08:00
anytls
5852b5ba94
Update anytls
Co-authored-by: anytls <anytls>
2025-06-21 18:07:11 +08:00
Rambling2076
655674bb9b
Fix missing with_tailscale in Dockerfile
Signed-off-by: Rambling2076 <Rambling2076@proton.me>
2025-06-21 18:07:11 +08:00
世界
a55d597212
Fail when default DNS server not found 2025-06-21 18:07:11 +08:00
世界
183aed8253
Update gVisor to 20250319.0 2025-06-21 18:07:10 +08:00
世界
8f1885bef8
Explicitly reject detour to empty direct outbounds 2025-06-21 18:07:10 +08:00
世界
4a13f9828c
Add netns support 2025-06-21 18:07:10 +08:00
世界
659b4988ce
Add wildcard name support for predefined records 2025-06-21 18:07:10 +08:00
世界
de1053f2cf
Remove map usage in options 2025-06-21 18:07:09 +08:00
世界
f7200c72f2
Fix unhandled DNS loop 2025-06-21 18:07:09 +08:00
世界
0febed9b60
Add wildcard-sni support for shadow-tls inbound 2025-06-21 18:07:09 +08:00
k9982874
ba2ad571d3
Add ntp protocol sniffing 2025-06-21 18:07:08 +08:00
世界
36c171aeac
option: Fix marshal legacy DNS options 2025-06-21 18:07:08 +08:00
世界
76630b474a
Make domain_resolver optional when only one DNS server is configured 2025-06-21 18:07:08 +08:00
世界
9a0d4e4ec6
Fix DNS lookup context pollution 2025-06-21 18:07:07 +08:00
世界
9eaebb970b
Fix http3 DNS server connecting to wrong address 2025-06-21 18:07:07 +08:00
Restia-Ashbell
8f890bcd9a
documentation: Fix typo 2025-06-21 18:07:06 +08:00
anytls
529c0a1e64
Update sing-anytls
Co-authored-by: anytls <anytls>
2025-06-21 18:07:06 +08:00
k9982874
00fd52854b
Fix hosts DNS server 2025-06-21 18:07:06 +08:00
世界
043954df8c
Fix UDP DNS server crash 2025-06-21 18:07:06 +08:00
世界
5acf9344f1
documentation: Fix missing ip_accept_any DNS rule option 2025-06-21 18:07:05 +08:00
世界
96f96b5b28
Fix anytls dialer usage 2025-06-21 18:07:05 +08:00
世界
2ad59c6bf1
Move predefined DNS server to rule action 2025-06-21 18:07:05 +08:00
世界
a3bbdaf61e
Fix domain resolver on direct outbound 2025-06-21 18:07:04 +08:00
Zephyruso
344ee5df43
Fix missing AnyTLS display name 2025-06-21 18:07:04 +08:00
anytls
47c35f5e7a
Update sing-anytls
Co-authored-by: anytls <anytls>
2025-06-21 18:07:04 +08:00
Estel
7101407b87
documentation: Fix typo
Signed-off-by: Estel <callmebedrockdigger@gmail.com>
2025-06-21 18:07:04 +08:00
TargetLocked
79f84b4333
Fix parsing legacy DNS options 2025-06-21 18:07:03 +08:00
世界
b9d37ce9f7
Fix DNS fallback 2025-06-21 18:07:03 +08:00
世界
e73bb73290
documentation: Fix missing hosts DNS server 2025-06-21 18:07:02 +08:00
anytls
f1623edb5a
Add MinIdleSession option to AnyTLS outbound
Co-authored-by: anytls <anytls>
2025-06-21 18:07:02 +08:00
ReleTor
f42aba5d46
documentation: Minor fixes 2025-06-21 18:07:02 +08:00
libtry486
67d934a301
documentation: Fix typo
fix typo

Signed-off-by: libtry486 <89328481+libtry486@users.noreply.github.com>
2025-06-21 18:07:01 +08:00
Alireza Ahmadi
9fbbc0a74e
Fix Outbound deadlock 2025-06-21 18:07:01 +08:00
世界
ec0c882efe
documentation: Fix AnyTLS doc 2025-06-21 18:07:01 +08:00
anytls
167a674b8c
Add AnyTLS protocol 2025-06-21 18:07:00 +08:00
世界
8df3f470a0
Migrate to stdlib ECH support 2025-06-21 18:07:00 +08:00
世界
e338c88a5d
Add fallback local DNS server for iOS 2025-06-21 18:06:59 +08:00
世界
4b28d626b5
Get darwin local DNS server from libresolv 2025-06-21 18:06:59 +08:00
世界
aa9bceecb2
Improve resolve action 2025-06-21 18:06:58 +08:00
世界
f10bce28a3
Add back port hopping to hysteria 1 2025-06-21 18:06:58 +08:00
xchacha20-poly1305
7d4f76abea
Remove single quotes of raw Moziila certs 2025-06-21 18:06:57 +08:00
世界
9e27c304b9
Add Tailscale endpoint 2025-06-21 18:06:56 +08:00
世界
b2cb1a39a6
Build legacy binaries with latest Go 2025-06-21 18:06:56 +08:00
世界
0b790fbabe
documentation: Remove outdated icons 2025-06-21 18:06:55 +08:00
世界
56e6653c6e
documentation: Certificate store 2025-06-21 18:06:55 +08:00
世界
5738174060
documentation: TLS fragment 2025-06-21 18:06:54 +08:00
世界
909893afa9
documentation: Outbound domain resolver 2025-06-21 18:06:54 +08:00
世界
efdf801332
documentation: Refactor DNS 2025-06-21 18:06:54 +08:00
世界
88fa375f7e
Add certificate store 2025-06-21 18:06:53 +08:00
世界
f7797e9d34
Add TLS fragment support 2025-06-21 18:06:53 +08:00
世界
fb7a7239fd
refactor: Outbound domain resolver 2025-06-21 18:06:53 +08:00
世界
bca97c10a4
refactor: DNS 2025-06-21 18:06:45 +08:00
世界
7d3ee29bd0
Also skip duplicate sniff for TCP 2025-06-21 12:57:27 +08:00
世界
cba0e46aba
Fix log for rejected connections 2025-06-21 12:57:26 +08:00
10 changed files with 134 additions and 41 deletions

View File

@ -437,28 +437,24 @@ jobs:
platform: ios
scheme: SFI
destination: 'generic/platform=iOS'
archive: build/SFI.xcarchive
upload: SFI/Upload.plist
- name: macOS
if: ${{ github.event_name != 'workflow_dispatch' || inputs.build == 'All' || inputs.build == 'Apple' || inputs.build == 'app-store'|| inputs.build == 'macOS' }}
platform: macos
scheme: SFM
destination: 'generic/platform=macOS'
archive: build/SFM.xcarchive
upload: SFI/Upload.plist
- name: tvOS
if: ${{ github.event_name != 'workflow_dispatch' || inputs.build == 'All' || inputs.build == 'Apple' || inputs.build == 'app-store'|| inputs.build == 'tvOS' }}
platform: tvos
scheme: SFT
destination: 'generic/platform=tvOS'
archive: build/SFT.xcarchive
upload: SFI/Upload.plist
- name: macOS-standalone
if: ${{ github.event_name != 'workflow_dispatch' || inputs.build == 'All' || inputs.build == 'Apple' || inputs.build == 'macOS-standalone' }}
platform: macos
scheme: SFM.System
destination: 'generic/platform=macOS'
archive: build/SFM.System.xcarchive
export: SFM.System/Export.plist
export_path: build/SFM.System
steps:
@ -543,6 +539,12 @@ jobs:
export PATH="$PATH:$(go env GOPATH)/bin"
go run ./cmd/internal/build_libbox -target apple -platform ${{ matrix.platform }}
mv Libbox.xcframework clients/apple
- name: Build library with tailscale
if: matrix.if && (matrix.name == 'iOS' || matrix.name == 'tvOS')
run: |-
export PATH="$PATH:$(go env GOPATH)/bin"
go run ./cmd/internal/build_libbox -target apple -platform ${{ matrix.platform }} -tailscale
mv Libbox.xcframework clients/apple/Libbox.WithTailscale.xcframework
- name: Update macOS version
if: matrix.if && matrix.name == 'macOS' && github.event_name == 'workflow_dispatch'
run: |-
@ -561,18 +563,71 @@ jobs:
-scheme "${{ matrix.scheme }}" \
-configuration Release \
-destination "${{ matrix.destination }}" \
-archivePath "${{ matrix.archive }}" \
-archivePath "build/${{ matrix.scheme }}.xcarchive" \
-allowProvisioningUpdates \
-authenticationKeyPath $ASC_KEY_PATH \
-authenticationKeyID $ASC_KEY_ID \
-authenticationKeyIssuerID $ASC_KEY_ISSUER_ID
- name: Build with Tailscale
if: matrix.if && (matrix.name == 'iOS' || matrix.name == 'tvOS')
run: |-
cd clients/apple
mv Libbox.xcframework Libbox.WithoutTailscale.xcframework
mv Libbox.WithTailscale.xcframework Libbox.xcframework
xcodebuild archive \
-scheme "${{ matrix.scheme }}" \
-configuration Release \
-destination "${{ matrix.destination }}" \
-archivePath "build/${{ matrix.scheme }}.WithTailscale.xcarchive" \
-allowProvisioningUpdates \
-authenticationKeyPath $ASC_KEY_PATH \
-authenticationKeyID $ASC_KEY_ID \
-authenticationKeyIssuerID $ASC_KEY_ISSUER_ID
- name: Export IPA
if: matrix.if && (matrix.name == 'iOS' || matrix.name == 'tvOS') && github.event_name == 'workflow_dispatch'
run: |-
pushd clients/apple
xcodebuild -exportArchive \
-archivePath "build/${{ matrix.scheme }}.xcarchive" \
-exportOptionsPlist SFI/Export.plist \
-exportPath "build/${{ matrix.scheme }}" \
-allowProvisioningUpdates \
-authenticationKeyPath $ASC_KEY_PATH \
-authenticationKeyID $ASC_KEY_ID \
-authenticationKeyIssuerID $ASC_KEY_ISSUER_ID
cp build/${{ matrix.scheme }}/sing-box.ipa .
popd
mkdir -p dist
cp clients/apple/sing-box.ipa "dist/${{ matrix.scheme }}-${{ needs.calculate_version.outputs.version }}.ipa"
- name: Export IPA with Tailscale
if: matrix.if && (matrix.name == 'iOS' || matrix.name == 'tvOS') && github.event_name == 'workflow_dispatch'
run: |-
pushd clients/apple
xcodebuild -exportArchive \
-archivePath "build/${{ matrix.scheme }}.WithTailscale.xcarchive" \
-exportOptionsPlist SFI/Export.plist \
-exportPath "build/${{ matrix.scheme }}.WithTailscale" \
-allowProvisioningUpdates \
-authenticationKeyPath $ASC_KEY_PATH \
-authenticationKeyID $ASC_KEY_ID \
-authenticationKeyIssuerID $ASC_KEY_ISSUER_ID
cp build/${{ matrix.scheme }}.WithTailscale/sing-box.ipa .
popd
mkdir -p dist
cp clients/apple/sing-box.ipa "dist/${{ matrix.scheme }}-${{ needs.calculate_version.outputs.version }}-WithTailscale.ipa"
- name: Upload IPA
if: matrix.if && (matrix.name == 'iOS' || matrix.name == 'tvOS') && github.event_name == 'workflow_dispatch'
uses: actions/upload-artifact@v4
with:
name: binary-${{ matrix.name }}-ipa
path: 'dist'
- name: Upload to App Store Connect
if: matrix.if && matrix.name != 'macOS-standalone' && github.event_name == 'workflow_dispatch'
run: |-
go run -v ./cmd/internal/app_store_connect cancel_app_store ${{ matrix.platform }}
cd clients/apple
xcodebuild -exportArchive \
-archivePath "${{ matrix.archive }}" \
-archivePath "build/${{ matrix.scheme }}.xcarchive" \
-exportOptionsPlist ${{ matrix.upload }} \
-allowProvisioningUpdates \
-authenticationKeyPath $ASC_KEY_PATH \
@ -587,7 +642,7 @@ jobs:
run: |-
pushd clients/apple
xcodebuild -exportArchive \
-archivePath "${{ matrix.archive }}" \
-archivePath "build/${{ matrix.scheme }}.xcarchive" \
-exportOptionsPlist ${{ matrix.export }} \
-exportPath "${{ matrix.export_path }}"
brew install create-dmg
@ -600,13 +655,13 @@ jobs:
--skip-jenkins \
SFM.dmg "${{ matrix.export_path }}/SFM.app"
xcrun notarytool submit "SFM.dmg" --wait --keychain-profile "notarytool-password"
cd "${{ matrix.archive }}"
cd "build/${{ matrix.scheme }}.xcarchive"
zip -r SFM.dSYMs.zip dSYMs
popd
mkdir -p dist
cp clients/apple/SFM.dmg "dist/SFM-${VERSION}-universal.dmg"
cp "clients/apple/${{ matrix.archive }}/SFM.dSYMs.zip" "dist/SFM-${VERSION}-universal.dSYMs.zip"
cp "clients/apple/build/${{ matrix.scheme }}.xcarchive/SFM.dSYMs.zip" "dist/SFM-${VERSION}-universal.dSYMs.zip"
- name: Upload image
if: matrix.if && matrix.name == 'macOS-standalone' && github.event_name == 'workflow_dispatch'
uses: actions/upload-artifact@v4

View File

@ -108,6 +108,16 @@ upload_ios_app_store:
cd ../sing-box-for-apple && \
xcodebuild -exportArchive -archivePath build/SFI.xcarchive -exportOptionsPlist SFI/Upload.plist -allowProvisioningUpdates
export_ios_ipa:
cd ../sing-box-for-apple && \
xcodebuild -exportArchive -archivePath build/SFI.xcarchive -exportOptionsPlist SFI/Export.plist -allowProvisioningUpdates -exportPath build/SFI && \
cp build/SFI/sing-box.ipa dist/SFI.ipa
upload_ios_ipa:
cd dist && \
cp SFI.ipa "SFI-${VERSION}.ipa" && \
ghr --replace --draft --prerelease "v${VERSION}" "SFI-${VERSION}.ipa"
release_ios: build_ios upload_ios_app_store
build_macos:
@ -175,6 +185,16 @@ upload_tvos_app_store:
cd ../sing-box-for-apple && \
xcodebuild -exportArchive -archivePath "build/SFT.xcarchive" -exportOptionsPlist SFI/Upload.plist -allowProvisioningUpdates
export_tvos_ipa:
cd ../sing-box-for-apple && \
xcodebuild -exportArchive -archivePath "build/SFT.xcarchive" -exportOptionsPlist SFI/Export.plist -allowProvisioningUpdates -exportPath build/SFT && \
cp build/SFT/sing-box.ipa dist/SFT.ipa
upload_tvos_ipa:
cd dist && \
cp SFT.ipa "SFT-${VERSION}.ipa" && \
ghr --replace --draft --prerelease "v${VERSION}" "SFT-${VERSION}.ipa"
release_tvos: build_tvos upload_tvos_app_store
update_apple_version:

View File

@ -53,11 +53,11 @@ type InboundContext struct {
// sniffer
Protocol string
Domain string
Client string
SniffContext any
PacketSniffError error
Protocol string
Domain string
Client string
SniffContext any
SniffError error
// cache

View File

@ -16,15 +16,17 @@ import (
)
var (
debugEnabled bool
target string
platform string
debugEnabled bool
target string
platform string
withTailscale bool
)
func init() {
flag.BoolVar(&debugEnabled, "debug", false, "enable debug")
flag.StringVar(&target, "target", "android", "target platform")
flag.StringVar(&platform, "platform", "", "specify platform")
flag.BoolVar(&withTailscale, "tailscale", false, "build tailscale for iOS and tvOS")
}
func main() {
@ -151,7 +153,9 @@ func buildApple() {
"-v",
"-target", bindTarget,
"-libname=box",
"-tags-macos=" + strings.Join(memcTags, ","),
}
if withTailscale {
args = append(args, "-tags-macos="+strings.Join(memcTags, ","))
}
if !debugEnabled {
@ -161,6 +165,9 @@ func buildApple() {
}
tags := append(sharedTags, iosTags...)
if withTailscale {
tags = append(tags, memcTags...)
}
if debugEnabled {
tags = append(tags, debugTags...)
}

View File

@ -96,7 +96,7 @@ parseLine:
}
if !ignored {
ignoredLines++
logger.Debug("ignored unsupported rule with modifier: ", paramParts[0], ": ", ruleLine)
logger.Debug("ignored unsupported rule with modifier: ", paramParts[0], ": ", originRuleLine)
continue parseLine
}
}
@ -124,34 +124,35 @@ parseLine:
ruleLine = ruleLine[1 : len(ruleLine)-1]
if ignoreIPCIDRRegexp(ruleLine) {
ignoredLines++
logger.Debug("ignored unsupported rule with IPCIDR regexp: ", ruleLine)
logger.Debug("ignored unsupported rule with IPCIDR regexp: ", originRuleLine)
continue
}
isRegexp = true
} else {
if strings.Contains(ruleLine, "://") {
ruleLine = common.SubstringAfter(ruleLine, "://")
isSuffix = true
}
if strings.Contains(ruleLine, "/") {
ignoredLines++
logger.Debug("ignored unsupported rule with path: ", ruleLine)
logger.Debug("ignored unsupported rule with path: ", originRuleLine)
continue
}
if strings.Contains(ruleLine, "?") || strings.Contains(ruleLine, "&") {
ignoredLines++
logger.Debug("ignored unsupported rule with query: ", ruleLine)
logger.Debug("ignored unsupported rule with query: ", originRuleLine)
continue
}
if strings.Contains(ruleLine, "[") || strings.Contains(ruleLine, "]") ||
strings.Contains(ruleLine, "(") || strings.Contains(ruleLine, ")") ||
strings.Contains(ruleLine, "!") || strings.Contains(ruleLine, "#") {
ignoredLines++
logger.Debug("ignored unsupported cosmetic filter: ", ruleLine)
logger.Debug("ignored unsupported cosmetic filter: ", originRuleLine)
continue
}
if strings.Contains(ruleLine, "~") {
ignoredLines++
logger.Debug("ignored unsupported rule modifier: ", ruleLine)
logger.Debug("ignored unsupported rule modifier: ", originRuleLine)
continue
}
var domainCheck string
@ -170,13 +171,13 @@ parseLine:
_, ipErr := parseADGuardIPCIDRLine(ruleLine)
if ipErr == nil {
ignoredLines++
logger.Debug("ignored unsupported rule with IPCIDR: ", ruleLine)
logger.Debug("ignored unsupported rule with IPCIDR: ", originRuleLine)
continue
}
if M.ParseSocksaddr(domainCheck).Port != 0 {
logger.Debug("ignored unsupported rule with port: ", ruleLine)
logger.Debug("ignored unsupported rule with port: ", originRuleLine)
} else {
logger.Debug("ignored unsupported rule with invalid domain: ", ruleLine)
logger.Debug("ignored unsupported rule with invalid domain: ", originRuleLine)
}
ignoredLines++
continue
@ -407,11 +408,9 @@ func ignoreIPCIDRRegexp(ruleLine string) bool {
ruleLine = ruleLine[13:]
} else if strings.HasPrefix(ruleLine, "^") {
ruleLine = ruleLine[1:]
} else {
return false
}
_, parseErr := strconv.ParseUint(common.SubstringBefore(ruleLine, "\\."), 10, 8)
return parseErr == nil
return common.Error(strconv.ParseUint(common.SubstringBefore(ruleLine, "\\."), 10, 8)) == nil ||
common.Error(strconv.ParseUint(common.SubstringBefore(ruleLine, "."), 10, 8)) == nil
}
func parseAdGuardHostLine(ruleLine string) (string, error) {

View File

@ -2,7 +2,7 @@
icon: material/alert-decagram
---
#### 1.12.0-beta.27
#### 1.12.0-beta.28
* Fixes and improvements

View File

@ -19,13 +19,21 @@ platform-specific function implementation, such as TUN transparent proxy impleme
## :material-download: Download
* [App Store](https://apps.apple.com/app/sing-box-vt/id6673731168)
* TestFlight (Beta)
* TestFlight (Beta) **1**
* [GitHub Releases](https://github.com/SagerNet/sing-box/releases) **2**
**1**:
TestFlight quota is only available to [sponsors](https://github.com/sponsors/nekohasekai)
(one-time sponsorships are accepted).
Once you donate, you can get an invitation by join our Telegram group for sponsors from [@yet_another_sponsor_bot](https://t.me/yet_another_sponsor_bot)
or sending us your Apple ID [via email](mailto:contact@sagernet.org).
**2**:
You can now download compiled IPAs for iOS and tvOS directly from GitHub releases,
but you need to purchase the **Apple Developer Program** to install them through AltStore or SideStore.
## :material-file-download: Download (macOS standalone version)
* [Homebrew Cask](https://formulae.brew.sh/cask/sfm)

View File

@ -64,7 +64,7 @@ icon: material/new-box
"auto_redirect_input_mark": "0x2023",
"auto_redirect_output_mark": "0x2024",
"loopback_address": [
"10.0.7.1"
"10.7.0.1"
],
"strict_route": true,
"route_address": [
@ -284,7 +284,7 @@ Connection output mark used by `auto_redirect`.
Loopback addresses make TCP connections to the specified address connect to the source address.
Setting option value to `10.0.7.1` achieves the same behavior as SideStore/StosVPN.
Setting option value to `10.7.0.1` achieves the same behavior as SideStore/StosVPN.
When `auto_redirect` is enabled, the same behavior can be achieved for LAN devices (not just local) as a gateway.

View File

@ -64,7 +64,7 @@ icon: material/new-box
"auto_redirect_input_mark": "0x2023",
"auto_redirect_output_mark": "0x2024",
"loopback_address": [
"10.0.7.1"
"10.7.0.1"
],
"strict_route": true,
"route_address": [
@ -283,7 +283,7 @@ tun 接口的 IPv6 前缀。
环回地址是用于使指向指定地址的 TCP 连接连接到来源地址的。
将选项值设置为 `10.0.7.1` 可实现与 SideStore/StosVPN 相同的行为。
将选项值设置为 `10.7.0.1` 可实现与 SideStore/StosVPN 相同的行为。
当启用 `auto_redirect` 时,可以作为网关为局域网设备(而不仅仅是本地)实现相同的行为。

View File

@ -501,6 +501,9 @@ func (r *Router) actionSniff(
if inputConn != nil {
if len(action.StreamSniffers) == 0 && len(action.PacketSniffers) > 0 {
return
} else if metadata.SniffError != nil && !errors.Is(metadata.SniffError, sniff.ErrNeedMoreData) {
r.logger.DebugContext(ctx, "packet sniff skipped due to previous error: ", metadata.SniffError)
return
}
var streamSniffers []sniff.StreamSniffer
if len(action.StreamSniffers) > 0 {
@ -525,6 +528,7 @@ func (r *Router) actionSniff(
action.Timeout,
streamSniffers...,
)
metadata.SniffError = err
if err == nil {
//goland:noinspection GoDeprecation
if action.OverrideDestination && M.IsDomainName(metadata.Domain) {
@ -549,8 +553,8 @@ func (r *Router) actionSniff(
} else if inputPacketConn != nil {
if len(action.PacketSniffers) == 0 && len(action.StreamSniffers) > 0 {
return
} else if metadata.PacketSniffError != nil && !errors.Is(metadata.PacketSniffError, sniff.ErrNeedMoreData) {
r.logger.DebugContext(ctx, "packet sniff skipped due to previous error: ", metadata.PacketSniffError)
} else if metadata.SniffError != nil && !errors.Is(metadata.SniffError, sniff.ErrNeedMoreData) {
r.logger.DebugContext(ctx, "packet sniff skipped due to previous error: ", metadata.SniffError)
return
}
var packetSniffers []sniff.PacketSniffer
@ -598,7 +602,7 @@ func (r *Router) actionSniff(
return
}
} else {
if len(packetBuffers) > 0 || metadata.PacketSniffError != nil {
if len(packetBuffers) > 0 || metadata.SniffError != nil {
err = sniff.PeekPacket(
ctx,
metadata,
@ -618,7 +622,7 @@ func (r *Router) actionSniff(
Destination: destination,
}
packetBuffers = append(packetBuffers, packetBuffer)
metadata.PacketSniffError = err
metadata.SniffError = err
if errors.Is(err, sniff.ErrNeedMoreData) {
// TODO: replace with generic message when there are more multi-packet protocols
r.logger.DebugContext(ctx, "attempt to sniff fragmented QUIC client hello")