mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-08-30 13:58:49 +08:00
Compare commits
111 Commits
7b63c24ca7
...
36c095f660
Author | SHA1 | Date | |
---|---|---|---|
![]() |
36c095f660 | ||
![]() |
71c0ed37b3 | ||
![]() |
860df103b4 | ||
![]() |
d6c9e0349f | ||
![]() |
16e05be1be | ||
![]() |
259a140453 | ||
![]() |
54760eeaaa | ||
![]() |
a870c36d2d | ||
![]() |
1054f58751 | ||
![]() |
6981dfe0c0 | ||
![]() |
719d0d3c31 | ||
![]() |
8f5fad3f9d | ||
![]() |
c2e9c30efc | ||
![]() |
3da06f0db8 | ||
![]() |
acb5065198 | ||
![]() |
c6a7d8c587 | ||
![]() |
a9ff1cbf78 | ||
![]() |
94e0d6b4ab | ||
![]() |
93c866a900 | ||
![]() |
40451f8957 | ||
![]() |
2a2ca1bef6 | ||
![]() |
e156abb0ab | ||
![]() |
94d70a2a97 | ||
![]() |
4b2cda1c76 | ||
![]() |
6e8e007352 | ||
![]() |
d18a35c414 | ||
![]() |
ea31ebb2a3 | ||
![]() |
0951711c08 | ||
![]() |
fdd8d3e23e | ||
![]() |
53feae6a6e | ||
![]() |
b63eba13ef | ||
![]() |
a2c52fb21b | ||
![]() |
01d06c0d29 | ||
![]() |
01b11f3d4e | ||
![]() |
567c98dc9e | ||
![]() |
f8a64a6554 | ||
![]() |
5dd021e979 | ||
![]() |
a3f9196fdc | ||
![]() |
42102b3fc4 | ||
![]() |
c0e5fe78ab | ||
![]() |
ad7bb47bf6 | ||
![]() |
58779f99ce | ||
![]() |
b14782771b | ||
![]() |
51816e0cd2 | ||
![]() |
0b7ea0c6c6 | ||
![]() |
cac33150d8 | ||
![]() |
31bd6bb5cb | ||
![]() |
7f26d21a28 | ||
![]() |
14a8e87e2f | ||
![]() |
38e3766c33 | ||
![]() |
1be391470a | ||
![]() |
560f567881 | ||
![]() |
53dfdd1ec6 | ||
![]() |
69fe3b16f1 | ||
![]() |
85d80deec8 | ||
![]() |
2570b11ea4 | ||
![]() |
d4d1ea7129 | ||
![]() |
5852b5ba94 | ||
![]() |
655674bb9b | ||
![]() |
a55d597212 | ||
![]() |
183aed8253 | ||
![]() |
8f1885bef8 | ||
![]() |
4a13f9828c | ||
![]() |
659b4988ce | ||
![]() |
de1053f2cf | ||
![]() |
f7200c72f2 | ||
![]() |
0febed9b60 | ||
![]() |
ba2ad571d3 | ||
![]() |
36c171aeac | ||
![]() |
76630b474a | ||
![]() |
9a0d4e4ec6 | ||
![]() |
9eaebb970b | ||
![]() |
8f890bcd9a | ||
![]() |
529c0a1e64 | ||
![]() |
00fd52854b | ||
![]() |
043954df8c | ||
![]() |
5acf9344f1 | ||
![]() |
96f96b5b28 | ||
![]() |
2ad59c6bf1 | ||
![]() |
a3bbdaf61e | ||
![]() |
344ee5df43 | ||
![]() |
47c35f5e7a | ||
![]() |
7101407b87 | ||
![]() |
79f84b4333 | ||
![]() |
b9d37ce9f7 | ||
![]() |
e73bb73290 | ||
![]() |
f1623edb5a | ||
![]() |
f42aba5d46 | ||
![]() |
67d934a301 | ||
![]() |
9fbbc0a74e | ||
![]() |
ec0c882efe | ||
![]() |
167a674b8c | ||
![]() |
8df3f470a0 | ||
![]() |
e338c88a5d | ||
![]() |
4b28d626b5 | ||
![]() |
aa9bceecb2 | ||
![]() |
f10bce28a3 | ||
![]() |
7d4f76abea | ||
![]() |
9e27c304b9 | ||
![]() |
b2cb1a39a6 | ||
![]() |
0b790fbabe | ||
![]() |
56e6653c6e | ||
![]() |
5738174060 | ||
![]() |
909893afa9 | ||
![]() |
efdf801332 | ||
![]() |
88fa375f7e | ||
![]() |
f7797e9d34 | ||
![]() |
fb7a7239fd | ||
![]() |
bca97c10a4 | ||
![]() |
7d3ee29bd0 | ||
![]() |
cba0e46aba |
75
.github/workflows/build.yml
vendored
75
.github/workflows/build.yml
vendored
@ -437,24 +437,28 @@ 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:
|
||||
@ -539,12 +543,6 @@ 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: |-
|
||||
@ -563,71 +561,18 @@ jobs:
|
||||
-scheme "${{ matrix.scheme }}" \
|
||||
-configuration Release \
|
||||
-destination "${{ matrix.destination }}" \
|
||||
-archivePath "build/${{ matrix.scheme }}.xcarchive" \
|
||||
-archivePath "${{ matrix.archive }}" \
|
||||
-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 "build/${{ matrix.scheme }}.xcarchive" \
|
||||
-archivePath "${{ matrix.archive }}" \
|
||||
-exportOptionsPlist ${{ matrix.upload }} \
|
||||
-allowProvisioningUpdates \
|
||||
-authenticationKeyPath $ASC_KEY_PATH \
|
||||
@ -642,7 +587,7 @@ jobs:
|
||||
run: |-
|
||||
pushd clients/apple
|
||||
xcodebuild -exportArchive \
|
||||
-archivePath "build/${{ matrix.scheme }}.xcarchive" \
|
||||
-archivePath "${{ matrix.archive }}" \
|
||||
-exportOptionsPlist ${{ matrix.export }} \
|
||||
-exportPath "${{ matrix.export_path }}"
|
||||
brew install create-dmg
|
||||
@ -655,13 +600,13 @@ jobs:
|
||||
--skip-jenkins \
|
||||
SFM.dmg "${{ matrix.export_path }}/SFM.app"
|
||||
xcrun notarytool submit "SFM.dmg" --wait --keychain-profile "notarytool-password"
|
||||
cd "build/${{ matrix.scheme }}.xcarchive"
|
||||
cd "${{ matrix.archive }}"
|
||||
zip -r SFM.dSYMs.zip dSYMs
|
||||
popd
|
||||
|
||||
mkdir -p dist
|
||||
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
|
||||
if: matrix.if && matrix.name == 'macOS-standalone' && github.event_name == 'workflow_dispatch'
|
||||
uses: actions/upload-artifact@v4
|
||||
@ -670,7 +615,7 @@ jobs:
|
||||
path: 'dist'
|
||||
upload:
|
||||
name: Upload builds
|
||||
if: always() && github.event_name == 'workflow_dispatch' && (inputs.build == 'All' || inputs.build == 'Binary' || inputs.build == 'Android' || inputs.build == 'Apple' || inputs.build == 'macOS-standalone')
|
||||
if: "!failure() && 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
|
||||
|
@ -57,7 +57,7 @@ type InboundContext struct {
|
||||
Domain string
|
||||
Client string
|
||||
SniffContext any
|
||||
PacketSniffError error
|
||||
SniffError error
|
||||
|
||||
// cache
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
icon: material/alert-decagram
|
||||
---
|
||||
|
||||
#### 1.12.0-beta.27
|
||||
#### 1.12.0-beta.28
|
||||
|
||||
* Fixes and improvements
|
||||
|
||||
|
@ -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.
|
||||
|
||||
|
@ -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` 时,可以作为网关为局域网设备(而不仅仅是本地)实现相同的行为。
|
||||
|
||||
|
@ -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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user