Compare commits

..

108 Commits

Author SHA1 Message Date
renovate[bot]
35df5635c5
[dependencies] Update golangci/golangci-lint-action action to v8 2025-06-20 05:23:27 +00:00
世界
8f4bbf9a7a
documentation: Bump version 2025-06-20 13:21:44 +08:00
世界
9e3b34ea50
Add API to dump AdGuard rules 2025-06-20 13:21:22 +08:00
Sukka
983421c1cb
Improve AdGuard rule-set parser 2025-06-20 13:21:05 +08:00
Restia-Ashbell
4861ceb6ee
Add ECH support for uTLS 2025-06-20 13:21:04 +08:00
世界
4f4e3eb8c3
Improve TLS fragments 2025-06-20 13:21:04 +08:00
世界
7b7feb794e
Add cache support for ssm-api 2025-06-20 13:21:04 +08:00
世界
b3b8d1fa29
Fix service will not be closed 2025-06-20 13:21:04 +08:00
世界
da924b51c8
Add loopback address support for tun 2025-06-20 13:21:04 +08:00
世界
fb3983ff6d
Fix tproxy listener 2025-06-20 13:21:04 +08:00
世界
07ec062876
Fix systemd package 2025-06-20 13:21:04 +08:00
世界
80f43fa51b
Fix missing home for derp service 2025-06-20 13:21:03 +08:00
Zero Clover
e0e9160290
documentation: Fix services 2025-06-20 13:21:03 +08:00
世界
5d1f13385b
Fix dns.client_subnet ignored 2025-06-20 13:21:03 +08:00
世界
9ef08196a4
documentation: Minor fixes 2025-06-20 13:21:03 +08:00
世界
cf26a7b6f6
Fix tailscale forward 2025-06-20 13:21:03 +08:00
世界
49efb2b8de
Minor fixes 2025-06-20 13:21:03 +08:00
世界
965bec8967
Add SSM API service 2025-06-20 13:21:03 +08:00
世界
cc34e8391d
Add resolved service and DNS server 2025-06-20 13:21:02 +08:00
世界
b89158efb9
Add DERP service 2025-06-20 13:20:54 +08:00
世界
a226bdca28
Add service component type 2025-06-20 13:20:53 +08:00
世界
360130af7b
Fix tproxy tcp control 2025-06-20 13:20:53 +08:00
愚者
f327ea7737
release: Fix build tags for android
Signed-off-by: 愚者 <11926619+FansChou@users.noreply.github.com>
2025-06-20 13:20:53 +08:00
世界
90d6de9220
prevent creation of bind and mark controls on unsupported platforms 2025-06-20 13:20:53 +08:00
PuerNya
6d71e440e0
documentation: Fix description of reject DNS action behavior 2025-06-20 13:20:52 +08:00
Restia-Ashbell
d249150a63
Fix TLS record fragment 2025-06-20 13:20:52 +08:00
世界
b3921910e4
Add missing accept_routes option for Tailscale 2025-06-20 13:20:52 +08:00
世界
b9163feb77
Add TLS record fragment support 2025-06-20 13:20:52 +08:00
世界
40d7e13103
Fix set edns0 client subnet 2025-06-20 13:20:52 +08:00
世界
7b56fb370f
Update minor dependencies 2025-06-20 13:20:52 +08:00
世界
6036174a37
Update certmagic and providers 2025-06-20 13:20:52 +08:00
世界
6ed4a3e25e
Update protobuf and grpc 2025-06-20 13:20:52 +08:00
世界
168809cfe2
Add control options for listeners 2025-06-20 13:20:51 +08:00
世界
b6ca331c7d
Update quic-go to v0.52.0 2025-06-20 13:20:51 +08:00
世界
d2a04c4e41
Update utls to v1.7.2 2025-06-20 13:20:51 +08:00
世界
027ff49390
Handle EDNS version downgrade 2025-06-20 13:20:43 +08:00
世界
8936f41e54
documentation: Fix anytls padding scheme description 2025-06-20 13:20:42 +08:00
安容
e8a6ae0ac7
Report invalid DNS address early 2025-06-20 13:20:42 +08:00
世界
df36013d7d
Fix wireguard listen_port 2025-06-20 13:20:42 +08:00
世界
a9cd830a9a
clash-api: Add more meta api 2025-06-20 13:20:42 +08:00
世界
306abab55d
Fix DNS lookup 2025-06-20 13:20:41 +08:00
世界
f7a92111c5
Fix fetch ECH configs 2025-06-20 13:20:41 +08:00
reletor
dfe82895ab
documentation: Minor fixes 2025-06-20 13:20:41 +08:00
caelansar
973ab97813
Fix callback deletion in UDP transport 2025-06-20 13:20:41 +08:00
世界
a78f3cb116
documentation: Try to make the play review happy 2025-06-20 13:20:41 +08:00
世界
13037a56d8
Fix missing handling of legacy domain_strategy options 2025-06-20 13:20:41 +08:00
世界
3dc3a0b6e3
Improve local DNS server 2025-06-20 13:20:40 +08:00
anytls
577c51a1f1
Update anytls
Co-authored-by: anytls <anytls>
2025-06-20 13:20:25 +08:00
世界
64db52f638
Fix DNS dialer 2025-06-20 13:20:25 +08:00
世界
1b6521f5f8
release: Skip override version for iOS 2025-06-20 13:20:25 +08:00
iikira
ec8821fc94
Fix UDP DNS server crash
Signed-off-by: iikira <i2@mail.iikira.com>
2025-06-20 13:20:25 +08:00
ReleTor
c90e0ad48d
Fix fetch ECH configs 2025-06-20 13:20:24 +08:00
世界
38676a2f06
Allow direct outbounds without domain_resolver 2025-06-20 13:20:24 +08:00
世界
8d2b641f92
Fix Tailscale dialer 2025-06-20 13:20:24 +08:00
dyhkwong
f0bf1f0ae8
Fix DNS over QUIC stream close 2025-06-20 13:20:24 +08:00
anytls
084071e882
Update anytls
Co-authored-by: anytls <anytls>
2025-06-20 13:20:24 +08:00
Rambling2076
90499e90de
Fix missing with_tailscale in Dockerfile
Signed-off-by: Rambling2076 <Rambling2076@proton.me>
2025-06-20 13:20:23 +08:00
世界
20055a362c
Fail when default DNS server not found 2025-06-20 13:20:23 +08:00
世界
376dd20254
Update gVisor to 20250319.0 2025-06-20 13:20:22 +08:00
世界
9a83c088b1
Explicitly reject detour to empty direct outbounds 2025-06-20 13:20:22 +08:00
世界
2b4c6f4ebb
Add netns support 2025-06-20 13:20:22 +08:00
世界
3ca6fee62f
Add wildcard name support for predefined records 2025-06-20 13:20:22 +08:00
世界
372ac544c8
Remove map usage in options 2025-06-20 13:20:22 +08:00
世界
138c1e4969
Fix unhandled DNS loop 2025-06-20 13:20:22 +08:00
世界
8a586db5f1
Add wildcard-sni support for shadow-tls inbound 2025-06-20 13:20:21 +08:00
k9982874
9959239b1a
Add ntp protocol sniffing 2025-06-20 13:20:13 +08:00
世界
4d96d78cd8
option: Fix marshal legacy DNS options 2025-06-20 13:20:13 +08:00
世界
d3d58b37e8
Make domain_resolver optional when only one DNS server is configured 2025-06-20 13:20:12 +08:00
世界
21e7bbdffc
Fix DNS lookup context pollution 2025-06-20 13:20:12 +08:00
世界
c0b6a876ff
Fix http3 DNS server connecting to wrong address 2025-06-20 13:20:12 +08:00
Restia-Ashbell
9b42c2efac
documentation: Fix typo 2025-06-20 13:20:12 +08:00
anytls
dc433869cd
Update sing-anytls
Co-authored-by: anytls <anytls>
2025-06-20 13:20:11 +08:00
k9982874
98db9aa3ec
Fix hosts DNS server 2025-06-20 13:20:11 +08:00
世界
46a7a2b457
Fix UDP DNS server crash 2025-06-20 13:20:11 +08:00
世界
279fa7379c
documentation: Fix missing ip_accept_any DNS rule option 2025-06-20 13:20:10 +08:00
世界
d896cbe623
Fix anytls dialer usage 2025-06-20 13:20:10 +08:00
世界
2b1d40c9b7
Move predefined DNS server to rule action 2025-06-20 13:20:10 +08:00
世界
ca304a9d6f
Fix domain resolver on direct outbound 2025-06-20 13:20:09 +08:00
Zephyruso
7bc733b5b1
Fix missing AnyTLS display name 2025-06-20 13:20:09 +08:00
anytls
a6a934a91b
Update sing-anytls
Co-authored-by: anytls <anytls>
2025-06-20 13:20:09 +08:00
Estel
cf5a34a318
documentation: Fix typo
Signed-off-by: Estel <callmebedrockdigger@gmail.com>
2025-06-20 13:20:08 +08:00
TargetLocked
9570568caa
Fix parsing legacy DNS options 2025-06-20 13:20:08 +08:00
世界
bf1962cfe4
Fix DNS fallback 2025-06-20 13:20:08 +08:00
世界
e6a07492d0
documentation: Fix missing hosts DNS server 2025-06-20 13:20:07 +08:00
anytls
36b12f4ab5
Add MinIdleSession option to AnyTLS outbound
Co-authored-by: anytls <anytls>
2025-06-20 13:20:07 +08:00
ReleTor
bc0cbef785
documentation: Minor fixes 2025-06-20 13:20:07 +08:00
libtry486
8dc7698c5f
documentation: Fix typo
fix typo

Signed-off-by: libtry486 <89328481+libtry486@users.noreply.github.com>
2025-06-20 13:20:06 +08:00
Alireza Ahmadi
cc59cb27e9
Fix Outbound deadlock 2025-06-20 13:20:06 +08:00
世界
0e1c8a1134
documentation: Fix AnyTLS doc 2025-06-20 13:20:06 +08:00
anytls
418f6fff49
Add AnyTLS protocol 2025-06-20 13:20:06 +08:00
世界
e5f87fab4b
Migrate to stdlib ECH support 2025-06-20 13:20:05 +08:00
世界
61e9a9f674
Add fallback local DNS server for iOS 2025-06-20 13:20:05 +08:00
世界
19fd3e836e
Get darwin local DNS server from libresolv 2025-06-20 13:20:05 +08:00
世界
78515fd9c7
Improve resolve action 2025-06-20 13:20:04 +08:00
世界
7506b2711c
Add back port hopping to hysteria 1 2025-06-20 13:20:04 +08:00
xchacha20-poly1305
07817df680
Remove single quotes of raw Moziila certs 2025-06-20 13:20:03 +08:00
世界
dc9b7c880d
Add Tailscale endpoint 2025-06-20 13:20:03 +08:00
世界
b79f1b2540
Build legacy binaries with latest Go 2025-06-20 13:20:03 +08:00
世界
7487fa28be
documentation: Remove outdated icons 2025-06-20 13:20:03 +08:00
世界
10c7c67e3c
documentation: Certificate store 2025-06-20 13:20:02 +08:00
世界
ca2a10f9f6
documentation: TLS fragment 2025-06-20 13:20:02 +08:00
世界
ddc6cdc3fb
documentation: Outbound domain resolver 2025-06-20 13:20:01 +08:00
世界
2e96569fef
documentation: Refactor DNS 2025-06-20 13:20:01 +08:00
世界
fe5ee7d31d
Add certificate store 2025-06-20 13:20:01 +08:00
世界
06c2824df9
Add TLS fragment support 2025-06-20 13:20:01 +08:00
世界
b28d19cfa7
refactor: Outbound domain resolver 2025-06-20 13:20:01 +08:00
世界
1709ad7f7f
refactor: DNS 2025-06-20 13:19:42 +08:00
世界
842f209da0
Fix log for rejected connections 2025-06-20 13:12:49 +08:00
10 changed files with 41 additions and 134 deletions

View File

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

View File

@ -108,16 +108,6 @@ upload_ios_app_store:
cd ../sing-box-for-apple && \ cd ../sing-box-for-apple && \
xcodebuild -exportArchive -archivePath build/SFI.xcarchive -exportOptionsPlist SFI/Upload.plist -allowProvisioningUpdates 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 release_ios: build_ios upload_ios_app_store
build_macos: build_macos:
@ -185,16 +175,6 @@ upload_tvos_app_store:
cd ../sing-box-for-apple && \ cd ../sing-box-for-apple && \
xcodebuild -exportArchive -archivePath "build/SFT.xcarchive" -exportOptionsPlist SFI/Upload.plist -allowProvisioningUpdates 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 release_tvos: build_tvos upload_tvos_app_store
update_apple_version: update_apple_version:

View File

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

View File

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

View File

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

View File

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

View File

@ -19,21 +19,13 @@ platform-specific function implementation, such as TUN transparent proxy impleme
## :material-download: Download ## :material-download: Download
* [App Store](https://apps.apple.com/app/sing-box-vt/id6673731168) * [App Store](https://apps.apple.com/app/sing-box-vt/id6673731168)
* TestFlight (Beta) **1** * TestFlight (Beta)
* [GitHub Releases](https://github.com/SagerNet/sing-box/releases) **2**
**1**:
TestFlight quota is only available to [sponsors](https://github.com/sponsors/nekohasekai) TestFlight quota is only available to [sponsors](https://github.com/sponsors/nekohasekai)
(one-time sponsorships are accepted). (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) 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). 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) ## :material-file-download: Download (macOS standalone version)
* [Homebrew Cask](https://formulae.brew.sh/cask/sfm) * [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_input_mark": "0x2023",
"auto_redirect_output_mark": "0x2024", "auto_redirect_output_mark": "0x2024",
"loopback_address": [ "loopback_address": [
"10.7.0.1" "10.0.7.1"
], ],
"strict_route": true, "strict_route": true,
"route_address": [ "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. Loopback addresses make TCP connections to the specified address connect to the source address.
Setting option value to `10.7.0.1` achieves the same behavior as SideStore/StosVPN. Setting option value to `10.0.7.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. 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_input_mark": "0x2023",
"auto_redirect_output_mark": "0x2024", "auto_redirect_output_mark": "0x2024",
"loopback_address": [ "loopback_address": [
"10.7.0.1" "10.0.7.1"
], ],
"strict_route": true, "strict_route": true,
"route_address": [ "route_address": [
@ -283,7 +283,7 @@ tun 接口的 IPv6 前缀。
环回地址是用于使指向指定地址的 TCP 连接连接到来源地址的。 环回地址是用于使指向指定地址的 TCP 连接连接到来源地址的。
将选项值设置为 `10.7.0.1` 可实现与 SideStore/StosVPN 相同的行为。 将选项值设置为 `10.0.7.1` 可实现与 SideStore/StosVPN 相同的行为。
当启用 `auto_redirect` 时,可以作为网关为局域网设备(而不仅仅是本地)实现相同的行为。 当启用 `auto_redirect` 时,可以作为网关为局域网设备(而不仅仅是本地)实现相同的行为。

View File

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