mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-08-30 13:58:49 +08:00
Compare commits
109 Commits
36c095f660
...
7b63c24ca7
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7b63c24ca7 | ||
![]() |
3b7f40d73b | ||
![]() |
46bb372a37 | ||
![]() |
9e3b34ea50 | ||
![]() |
983421c1cb | ||
![]() |
4861ceb6ee | ||
![]() |
4f4e3eb8c3 | ||
![]() |
7b7feb794e | ||
![]() |
b3b8d1fa29 | ||
![]() |
da924b51c8 | ||
![]() |
fb3983ff6d | ||
![]() |
07ec062876 | ||
![]() |
80f43fa51b | ||
![]() |
e0e9160290 | ||
![]() |
5d1f13385b | ||
![]() |
9ef08196a4 | ||
![]() |
cf26a7b6f6 | ||
![]() |
49efb2b8de | ||
![]() |
965bec8967 | ||
![]() |
cc34e8391d | ||
![]() |
b89158efb9 | ||
![]() |
a226bdca28 | ||
![]() |
360130af7b | ||
![]() |
f327ea7737 | ||
![]() |
90d6de9220 | ||
![]() |
6d71e440e0 | ||
![]() |
d249150a63 | ||
![]() |
b3921910e4 | ||
![]() |
b9163feb77 | ||
![]() |
40d7e13103 | ||
![]() |
7b56fb370f | ||
![]() |
6036174a37 | ||
![]() |
6ed4a3e25e | ||
![]() |
168809cfe2 | ||
![]() |
b6ca331c7d | ||
![]() |
d2a04c4e41 | ||
![]() |
027ff49390 | ||
![]() |
8936f41e54 | ||
![]() |
e8a6ae0ac7 | ||
![]() |
df36013d7d | ||
![]() |
a9cd830a9a | ||
![]() |
306abab55d | ||
![]() |
f7a92111c5 | ||
![]() |
dfe82895ab | ||
![]() |
973ab97813 | ||
![]() |
a78f3cb116 | ||
![]() |
13037a56d8 | ||
![]() |
3dc3a0b6e3 | ||
![]() |
577c51a1f1 | ||
![]() |
64db52f638 | ||
![]() |
1b6521f5f8 | ||
![]() |
ec8821fc94 | ||
![]() |
c90e0ad48d | ||
![]() |
38676a2f06 | ||
![]() |
8d2b641f92 | ||
![]() |
f0bf1f0ae8 | ||
![]() |
084071e882 | ||
![]() |
90499e90de | ||
![]() |
20055a362c | ||
![]() |
376dd20254 | ||
![]() |
9a83c088b1 | ||
![]() |
2b4c6f4ebb | ||
![]() |
3ca6fee62f | ||
![]() |
372ac544c8 | ||
![]() |
138c1e4969 | ||
![]() |
8a586db5f1 | ||
![]() |
9959239b1a | ||
![]() |
4d96d78cd8 | ||
![]() |
d3d58b37e8 | ||
![]() |
21e7bbdffc | ||
![]() |
c0b6a876ff | ||
![]() |
9b42c2efac | ||
![]() |
dc433869cd | ||
![]() |
98db9aa3ec | ||
![]() |
46a7a2b457 | ||
![]() |
279fa7379c | ||
![]() |
d896cbe623 | ||
![]() |
2b1d40c9b7 | ||
![]() |
ca304a9d6f | ||
![]() |
7bc733b5b1 | ||
![]() |
a6a934a91b | ||
![]() |
cf5a34a318 | ||
![]() |
9570568caa | ||
![]() |
bf1962cfe4 | ||
![]() |
e6a07492d0 | ||
![]() |
36b12f4ab5 | ||
![]() |
bc0cbef785 | ||
![]() |
8dc7698c5f | ||
![]() |
cc59cb27e9 | ||
![]() |
0e1c8a1134 | ||
![]() |
418f6fff49 | ||
![]() |
e5f87fab4b | ||
![]() |
61e9a9f674 | ||
![]() |
19fd3e836e | ||
![]() |
78515fd9c7 | ||
![]() |
7506b2711c | ||
![]() |
07817df680 | ||
![]() |
dc9b7c880d | ||
![]() |
b79f1b2540 | ||
![]() |
7487fa28be | ||
![]() |
10c7c67e3c | ||
![]() |
ca2a10f9f6 | ||
![]() |
ddc6cdc3fb | ||
![]() |
2e96569fef | ||
![]() |
fe5ee7d31d | ||
![]() |
06c2824df9 | ||
![]() |
b28d19cfa7 | ||
![]() |
1709ad7f7f | ||
![]() |
842f209da0 |
75
.github/workflows/build.yml
vendored
75
.github/workflows/build.yml
vendored
@ -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
|
||||
@ -615,7 +670,7 @@ jobs:
|
||||
path: 'dist'
|
||||
upload:
|
||||
name: Upload builds
|
||||
if: "!failure() && github.event_name == 'workflow_dispatch' && (inputs.build == 'All' || inputs.build == 'Binary' || inputs.build == 'Android' || inputs.build == 'Apple' || inputs.build == 'macOS-standalone')"
|
||||
if: always() && github.event_name == 'workflow_dispatch' && (inputs.build == 'All' || inputs.build == 'Binary' || inputs.build == 'Android' || inputs.build == 'Apple' || inputs.build == 'macOS-standalone')
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- calculate_version
|
||||
|
@ -53,11 +53,11 @@ type InboundContext struct {
|
||||
|
||||
// sniffer
|
||||
|
||||
Protocol string
|
||||
Domain string
|
||||
Client string
|
||||
SniffContext any
|
||||
SniffError error
|
||||
Protocol string
|
||||
Domain string
|
||||
Client string
|
||||
SniffContext any
|
||||
PacketSniffError error
|
||||
|
||||
// cache
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
icon: material/alert-decagram
|
||||
---
|
||||
|
||||
#### 1.12.0-beta.28
|
||||
#### 1.12.0-beta.27
|
||||
|
||||
* Fixes and improvements
|
||||
|
||||
|
@ -64,7 +64,7 @@ icon: material/new-box
|
||||
"auto_redirect_input_mark": "0x2023",
|
||||
"auto_redirect_output_mark": "0x2024",
|
||||
"loopback_address": [
|
||||
"10.7.0.1"
|
||||
"10.0.7.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.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.
|
||||
|
||||
|
@ -64,7 +64,7 @@ icon: material/new-box
|
||||
"auto_redirect_input_mark": "0x2023",
|
||||
"auto_redirect_output_mark": "0x2024",
|
||||
"loopback_address": [
|
||||
"10.7.0.1"
|
||||
"10.0.7.1"
|
||||
],
|
||||
"strict_route": true,
|
||||
"route_address": [
|
||||
@ -283,7 +283,7 @@ tun 接口的 IPv6 前缀。
|
||||
|
||||
环回地址是用于使指向指定地址的 TCP 连接连接到来源地址的。
|
||||
|
||||
将选项值设置为 `10.7.0.1` 可实现与 SideStore/StosVPN 相同的行为。
|
||||
将选项值设置为 `10.0.7.1` 可实现与 SideStore/StosVPN 相同的行为。
|
||||
|
||||
当启用 `auto_redirect` 时,可以作为网关为局域网设备(而不仅仅是本地)实现相同的行为。
|
||||
|
||||
|
@ -501,9 +501,6 @@ 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 {
|
||||
@ -528,7 +525,6 @@ func (r *Router) actionSniff(
|
||||
action.Timeout,
|
||||
streamSniffers...,
|
||||
)
|
||||
metadata.SniffError = err
|
||||
if err == nil {
|
||||
//goland:noinspection GoDeprecation
|
||||
if action.OverrideDestination && M.IsDomainName(metadata.Domain) {
|
||||
@ -553,8 +549,8 @@ func (r *Router) actionSniff(
|
||||
} else if inputPacketConn != nil {
|
||||
if len(action.PacketSniffers) == 0 && len(action.StreamSniffers) > 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)
|
||||
} else if metadata.PacketSniffError != nil && !errors.Is(metadata.PacketSniffError, sniff.ErrNeedMoreData) {
|
||||
r.logger.DebugContext(ctx, "packet sniff skipped due to previous error: ", metadata.PacketSniffError)
|
||||
return
|
||||
}
|
||||
var packetSniffers []sniff.PacketSniffer
|
||||
@ -602,7 +598,7 @@ func (r *Router) actionSniff(
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if len(packetBuffers) > 0 || metadata.SniffError != nil {
|
||||
if len(packetBuffers) > 0 || metadata.PacketSniffError != nil {
|
||||
err = sniff.PeekPacket(
|
||||
ctx,
|
||||
metadata,
|
||||
@ -622,7 +618,7 @@ func (r *Router) actionSniff(
|
||||
Destination: destination,
|
||||
}
|
||||
packetBuffers = append(packetBuffers, packetBuffer)
|
||||
metadata.SniffError = err
|
||||
metadata.PacketSniffError = 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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user