-
Notifications
You must be signed in to change notification settings - Fork 0
libcore: port to sing-box 1.13 (adapter.PlatformInterface + sing v0.8) #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7a8512b
ca0dcaf
43b6e17
505628f
2e6be45
afdaa75
05a5a79
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| export COMMIT_SING_BOX="32aea122752fdac1201d7d5ea3a6042ff90a030d" | ||
| export COMMIT_SING_BOX="8966dca291128e4801b1492b0ae6e68cc7bea214" | ||
| export COMMIT_LIBNEKO="1c47a3af71990a7b2192e03292b4d246c308ef0b" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,13 +6,13 @@ require ( | |
| github.com/dyhkwong/sing-juicity v0.0.3 | ||
| github.com/gofrs/uuid/v5 v5.4.0 | ||
| github.com/matsuridayo/libneko v1.0.0 // replaced | ||
| github.com/miekg/dns v1.1.67 | ||
| github.com/miekg/dns v1.1.72 | ||
| github.com/oschwald/maxminddb-golang v1.13.1 | ||
| github.com/reF1nd/sing-snell v0.0.6 // indirect | ||
| github.com/sagernet/quic-go v0.52.0-sing-box-mod.3 | ||
| github.com/sagernet/sing v0.7.18 | ||
| github.com/sagernet/quic-go v0.59.0-sing-box-mod.5 | ||
| github.com/sagernet/sing v0.8.10 | ||
| github.com/sagernet/sing-box v1.0.0 // replaced | ||
| github.com/sagernet/sing-tun v0.7.10 | ||
| github.com/sagernet/sing-tun v0.8.10 | ||
|
Comment on lines
+9
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Verify that all direct dependencies resolve correctly and that imports match API expectations
# Check that sing-box replace target is set to feat/port-1.13 or equivalent (lines 110-118)
sed -n '110,118p' libcore/go.mod | grep -A 5 'sing-box'
# Verify go.mod syntax is valid
cd libcore && go mod verifyRepository: hawkff/NekoBoxForAndroid Length of output: 325 🏁 Script executed: cat libcore/go.modRepository: hawkff/NekoBoxForAndroid Length of output: 5715 Reconcile sing-quic version mismatch between indirect dependency and replace directive. The indirect dependency declares The 🤖 Prompt for AI Agents |
||
| github.com/ulikunitz/xz v0.5.15 | ||
| golang.org/x/mobile v0.0.0-20240520174638-fa72addaaa1b | ||
| golang.org/x/sys v0.41.0 | ||
|
|
@@ -23,71 +23,76 @@ require ( | |
| github.com/amnezia-vpn/amneziawg-go v0.2.19 // indirect | ||
| github.com/andybalholm/brotli v1.1.0 // indirect | ||
| github.com/anytls/sing-anytls v0.0.11 // indirect | ||
| github.com/caddyserver/certmagic v0.23.0 // indirect | ||
| github.com/caddyserver/zerossl v0.1.3 // indirect | ||
| github.com/caddyserver/certmagic v0.25.2 // indirect | ||
| github.com/caddyserver/zerossl v0.1.5 // indirect | ||
| github.com/cretz/bine v0.2.0 // indirect | ||
| github.com/database64128/netx-go v0.1.1 // indirect | ||
| github.com/database64128/tfo-go/v2 v2.3.2 // indirect | ||
| github.com/florianl/go-nfqueue/v2 v2.0.2 // indirect | ||
| github.com/fsnotify/fsnotify v1.9.0 // indirect | ||
| github.com/go-chi/chi/v5 v5.2.3 // indirect | ||
| github.com/go-chi/chi/v5 v5.2.5 // indirect | ||
| github.com/go-chi/render v1.0.3 // indirect | ||
| github.com/go-ole/go-ole v1.3.0 // indirect | ||
| github.com/gobwas/httphead v0.1.0 // indirect | ||
| github.com/gobwas/pool v0.2.1 // indirect | ||
| github.com/godbus/dbus/v5 v5.2.2 // indirect | ||
| github.com/google/btree v1.1.3 // indirect | ||
| github.com/google/go-cmp v0.7.0 // indirect | ||
| github.com/hashicorp/yamux v0.1.2 // indirect | ||
| github.com/klauspost/compress v1.17.11 // indirect | ||
| github.com/klauspost/cpuid/v2 v2.2.10 // indirect | ||
| github.com/libdns/alidns v1.0.5-libdns.v1.beta1 // indirect | ||
| github.com/libdns/cloudflare v0.2.2-0.20250708034226-c574dccb31a6 // indirect | ||
| github.com/libdns/libdns v1.1.0 // indirect | ||
| github.com/insomniacslk/dhcp v0.0.0-20260220084031-5adc3eb26f91 // indirect | ||
| github.com/klauspost/compress v1.18.0 // indirect | ||
| github.com/klauspost/cpuid/v2 v2.3.0 // indirect | ||
| github.com/libdns/acmedns v0.5.0 // indirect | ||
| github.com/libdns/alidns v1.0.6 // indirect | ||
| github.com/libdns/cloudflare v0.2.2 // indirect | ||
| github.com/libdns/libdns v1.1.1 // indirect | ||
| github.com/logrusorgru/aurora v2.0.3+incompatible // indirect | ||
| github.com/mdlayher/netlink v1.7.3-0.20250113171957-fbb4dce95f42 // indirect | ||
| github.com/mdlayher/netlink v1.9.0 // indirect | ||
| github.com/mdlayher/socket v0.5.1 // indirect | ||
| github.com/metacubex/chacha v0.1.5 // indirect | ||
| github.com/metacubex/mihomo v1.19.13 // indirect | ||
| github.com/metacubex/randv2 v0.2.0 // indirect | ||
| github.com/metacubex/sing v0.5.5 // indirect | ||
| github.com/metacubex/tfo-go v0.0.0-20250921095601-b102db4216c0 // indirect | ||
| github.com/metacubex/utls v1.8.4 // indirect | ||
| github.com/mholt/acmez/v3 v3.1.2 // indirect | ||
| github.com/quic-go/qpack v0.5.1 // indirect | ||
| github.com/mholt/acmez/v3 v3.1.6 // indirect | ||
| github.com/pierrec/lz4/v4 v4.1.21 // indirect | ||
| github.com/quic-go/qpack v0.6.0 // indirect | ||
| github.com/sagernet/bbolt v0.0.0-20231014093535-ea5cb2fe9f0a // indirect | ||
| github.com/sagernet/cors v1.2.1 // indirect | ||
| github.com/sagernet/fswatch v0.1.1 // indirect | ||
| github.com/sagernet/gvisor v0.0.0-20250325023245-7a9c0f5725fb // indirect | ||
| github.com/sagernet/fswatch v0.1.2 // indirect | ||
| github.com/sagernet/gvisor v0.0.0-20250822052253-5558536cf237 // indirect | ||
| github.com/sagernet/netlink v0.0.0-20240612041022-b9a21c07ac6a // indirect | ||
| github.com/sagernet/nftables v0.3.0-beta.4 // indirect | ||
| github.com/sagernet/nftables v0.3.0-mod.2 // indirect | ||
| github.com/sagernet/sing-mux v0.3.4 // indirect | ||
| github.com/sagernet/sing-quic v0.5.2 // indirect | ||
| github.com/sagernet/sing-quic v0.6.1 // indirect | ||
| github.com/sagernet/sing-shadowsocks v0.2.8 // indirect | ||
| github.com/sagernet/sing-shadowsocks2 v0.2.1 // indirect | ||
| github.com/sagernet/sing-shadowtls v0.2.1-0.20250503051639-fcd445d33c11 // indirect | ||
| github.com/sagernet/sing-vmess v0.2.7 // indirect | ||
| github.com/sagernet/sing-vmess v0.2.8-0.20250909125414-3aed155119a1 // indirect | ||
| github.com/sagernet/smux v1.5.50-sing-box-mod.1 // indirect | ||
| github.com/sagernet/wireguard-go v0.0.1-beta.7 // indirect | ||
| github.com/sagernet/wireguard-go v0.0.2-beta.1.0.20260224074747-506b7631853c // indirect | ||
| github.com/sagernet/ws v0.0.0-20231204124109-acfe8907c854 // indirect | ||
| github.com/sirupsen/logrus v1.9.3 // indirect | ||
| github.com/tevino/abool v1.2.0 // indirect | ||
| github.com/u-root/uio v0.0.0-20240224005618-d2acac8f3701 // indirect | ||
| github.com/vishvananda/netns v0.0.5 // indirect | ||
| github.com/zeebo/blake3 v0.2.4 // indirect | ||
| gitlab.com/go-extension/aes-ccm v0.0.0-20230221065045-e58665ef23c7 // indirect | ||
| go.uber.org/atomic v1.11.0 // indirect | ||
| go.uber.org/multierr v1.11.0 // indirect | ||
| go.uber.org/zap v1.27.0 // indirect | ||
| go.uber.org/zap v1.27.1 // indirect | ||
| go.uber.org/zap/exp v0.3.0 // indirect | ||
| go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect | ||
| golang.org/x/crypto v0.48.0 // indirect | ||
| golang.org/x/exp v0.0.0-20250911091902-df9299821621 // indirect | ||
| golang.org/x/mod v0.32.0 // indirect | ||
| golang.org/x/net v0.49.0 // indirect | ||
| golang.org/x/exp v0.0.0-20251219203646-944ab1f22d93 // indirect | ||
| golang.org/x/mod v0.33.0 // indirect | ||
| golang.org/x/net v0.50.0 // indirect | ||
| golang.org/x/sync v0.19.0 // indirect | ||
| golang.org/x/text v0.34.0 // indirect | ||
| golang.org/x/time v0.9.0 // indirect | ||
| golang.org/x/tools v0.41.0 // indirect | ||
| golang.org/x/time v0.11.0 // indirect | ||
| golang.org/x/tools v0.42.0 // indirect | ||
| golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect | ||
| google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 // indirect | ||
| google.golang.org/grpc v1.73.0 // indirect | ||
| google.golang.org/protobuf v1.36.6 // indirect | ||
| google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect | ||
| google.golang.org/grpc v1.79.1 // indirect | ||
| google.golang.org/protobuf v1.36.11 // indirect | ||
| gvisor.dev/gvisor v0.0.0-20250606233247-e3c4c4cad86f // indirect | ||
| lukechampine.com/blake3 v1.3.0 // indirect | ||
| ) | ||
|
|
@@ -98,6 +103,10 @@ replace github.com/sagernet/sing-box => ../../sing-box | |
|
|
||
| replace github.com/sagernet/sing-vmess => github.com/starifly/sing-vmess v0.2.8-mod.1 | ||
|
|
||
| // sing-juicity was renamed dyhkwong -> exclavenetwork at v0.1.x; the import path | ||
| // in libcore stays dyhkwong. v0.1.4 targets quic-go v0.59 / sing v0.8 / sing-quic v0.6.1. | ||
| replace github.com/dyhkwong/sing-juicity => github.com/exclavenetwork/sing-juicity v0.1.4 | ||
|
|
||
| // replace github.com/sagernet/sing-quic => github.com/matsuridayo/sing-quic v0.0.0-20241009042333-b49ce60d9b36 | ||
| // replace github.com/sagernet/sing-quic => ../../sing-quic | ||
|
|
||
|
|
@@ -107,4 +116,4 @@ replace github.com/sagernet/sing-vmess => github.com/starifly/sing-vmess v0.2.8- | |
|
|
||
| // replace berty.tech/go-libtor => github.com/berty/go-libtor v0.0.0-20220627102132-9189eb6e3982 | ||
|
|
||
| replace github.com/sagernet/sing-quic => github.com/hawkff/sing-quic v0.5.3-0.20260618035506-f2f558c5aaba | ||
| replace github.com/sagernet/sing-quic => github.com/hawkff/sing-quic v0.6.2-0.20260623171805-c5b53db7a343 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major
🧩 Analysis chain
🏁 Script executed:
Repository: hawkff/NekoBoxForAndroid
Length of output: 227
🏁 Script executed:
Repository: hawkff/NekoBoxForAndroid
Length of output: 1540
🏁 Script executed:
Repository: hawkff/NekoBoxForAndroid
Length of output: 1523
🏁 Script executed:
Repository: hawkff/NekoBoxForAndroid
Length of output: 1435
🏁 Script executed:
Repository: hawkff/NekoBoxForAndroid
Length of output: 1019
🏁 Script executed:
Repository: hawkff/NekoBoxForAndroid
Length of output: 3205
🏁 Script executed:
Repository: hawkff/NekoBoxForAndroid
Length of output: 7771
🏁 Script executed:
Repository: hawkff/NekoBoxForAndroid
Length of output: 617
🏁 Script executed:
Repository: hawkff/NekoBoxForAndroid
Length of output: 5525
🏁 Script executed:
Repository: hawkff/NekoBoxForAndroid
Length of output: 762
🌐 Web query:
sing-box migration 1.13 inbound sniffing rule order scoped actions💡 Result:
In sing-box 1.13.0, legacy inbound sniffing fields (such as
sniff,sniff_timeout, andsniff_override_destinationdefined directly under an inbound) were removed [1][2]. To migrate these configurations, you must move the sniffing logic to theroute.rulessection using thesniffrule action [3][4]. When migrating, the sniffing process is now controlled by the order of your routing rules [3][4]. You should define a specific rule with theaction: sniffto trigger protocol detection on desired traffic [3][5]. Because these are standard routing rules, they follow the standard top-to-bottom evaluation order [3][4]. Key points for migration and usage: - Deprecation: The oldinbound.sniffoptions were effectively a pre-routing sniff operation [5][6]. The newsniffaction inroute.rulesgives you granular control over exactly which traffic is sniffed and when [3][4]. - Rule Order: Since sniffing is now a rule action, you can place it before or after other rules [3][4]. For example, you can sniff only traffic from a specific inbound or specific port by addinginboundorportmatchers to the same rule that contains theaction: sniff[3][4]. - Scoped Actions: By combiningaction: sniffwith other criteria (likeinboundtags), you can scope sniffing to specific connections rather than enabling it globally for all inbound traffic [3][4]. - Pre-match & Performance: Thesniffaction can be used for pre-matching, and it is recommended to define it early if subsequent rules (like DNS hijacking or specific routing) depend on the sniffed protocol or domain [3][5][4]. For complete examples of how to rewrite yourinboundsandrouteconfiguration to use the new action-based system, refer to the official sing-box migration guide [3][4].Citations:
Scope sniff/resolve rules to the mixed inbound and fix rule execution order.
These rules are unscoped, so
sniff/resolverun for all inbounds (TUN, mixed, and any direct mapping inbounds) even though the removed legacy fields were only on the mixed inbound. Additionally, the subsequentroute.rules.add(0, ...)DNS hijack rules are prepended to position 0, breaking the "emit them first" comment—the final rule order becomes[port 53 hijack, dns hijack, ..., sniff, resolve], causing DNS hijacking to evaluate before sniffing completes.Scope these actions to
TAG_MIXEDwhenkeepMixedInboundis true, matching the original inbound scope. For rule order, either:add(0, ...)prepending (after the DNS hijacks so they still evaluate first), orSee sing-box's migration examples at sing-box.sagernet.org/migration/ which scope legacy inbound actions by
inboundtag and place sniff before protocol-dependent rules like DNS hijacking.🤖 Prompt for AI Agents