English
Routing and rules
Ours: the syntax — modules/routing/router/src/syntax.rs, building conditions — modules/routing/router/src/lib.rs (default, unsupported), actions — the same place (action), rule-sets — rule_set.rs, remote.rs; process conditions — modules/routing/rule-process. The reference: option/rule.go, option/rule_action.go, route/rule/* of sing-box v1.14.4.
route rule conditions
All fields of v1.14.4's option/rule.go are decoded; the refusal comes when the rule is built (parse rule[N]: …).
| What | Status | Where | Verdict |
|---|---|---|---|
wifi_ssid, wifi_bssid | no | router/src/lib.rs (unsupported) | platform (Android/Apple/Windows); on Linux possible through NetworkManager/iwd — rarely needed |
network_is_expensive, network_is_constrained | no | the same place | platform |
package_name, package_name_regex | no | modules/routing/rule-process/src/lib.rs | platform (Android) |
clash_mode | no | router/src/lib.rs | junk while there is no Clash API (see other.md) |
interface_address, network_interface_address, default_interface_address | no | the same place | missing: interface addresses are already read by crates/runtime/src/host.rs |
preferred_by | no: not implemented yet | the same place | missing |
geoip, source_geoip, geosite as databases | different: a shorthand for the rule-sets geoip-<x>/geosite-<x>; the .dat databases themselves are read as rule-sets of the dat format | router/src/syntax.rs (conditions), router/src/dat.rs | — (in sing-box the databases were removed in 1.12) |
rule_set_ipcidr_match_source (the old name) | no, as in the reference | router/src/lib.rs | junk |
user, user_id, process_* | present (Linux, through inet_diag/procfs) | modules/routing/rule-process | — |
dns_server_address, dns_search_domain (also in dns.rules) | no: unknown field | — (not decoded) | missing |
source_mac_address, source_hostname | present (neighbours and DHCP leases) | router/src/item.rs | — |
Actions
| What | Status | Where | Verdict |
|---|---|---|---|
route with route-options: tls.fragment, tls.spoof (in sing-box tls_fragment*, tls_record_fragment, tls_spoof*) | no: …: not implemented yet | router/src/lib.rs (route_options) | missing: fragmentation already exists in the outbound's tls block, it needs to be carried from the rule |
resolve.server | different: forbidden in YAML, the server is chosen by dns.rules with outbound | router/src/syntax.rs (do_action) | — (design) |
reject reply | present: for TCP/UDP an error, as in the reference | modules/system/dispatch/src/lib.rs | — |
reject.no_drop | no: not in YAML, always false | router/src/syntax.rs (reject) | rarely needed |
bypass without an outbound in the process | different: the rule is skipped and checking goes on; with final: bypass the connection goes to a synthetic direct named bypass | crates/api/src/route.rs (Action::Bypass { outbound: None }), crates/native-config/src/rules.rs (Final::Bypass) | — |
bypass with an outbound | no: unavailable from YAML | router/src/syntax.rs (target) | rarely needed |
hijack-dns, sniff, resolve, route-options | present | — | — |
route
| What | Status | Where | Verdict |
|---|---|---|---|
route.dial.interfaces.strategy and others without auto_detect_interface/route.dial.interface | no: refused at build time | crates/kernel/src/instance.rs (reject_unimplemented) | — (as in the reference on platforms without a monitor) |
tcp_half_close_timeout | beyond the reference: a half-closed TCP connection is closed after the remaining direction has been idle (60 s by default); the reference waits for the other side to close forever | crates/relay/src/lib.rs (relay_stream_ended), crates/api/src/dispatch.rs (HALF_CLOSE_TIMEOUT) | — |
default_domain_resolver, rule_set, geoip, geosite | different (design) | crates/native-config/src/rules.rs | — |
Rule-sets
| What | Status | Where | Verdict |
|---|---|---|---|
Conditions inside a set: package_name*, wifi_*, network_is_*, network_interface_address, default_interface_address | no (inline and binary) | router/src/rule_set.rs (unsupported, binary_default) | see the route rule conditions |
AdGuard rules in .srs | present (ITEM_ADGUARD_DOMAIN) | libs/srs/src/binary.rs, router/src/rule_set.rs | — |
http_client with dial options other than detour | no | router/src/remote.rs (download_client) | missing |
http_client HTTP/2, HTTP/3 without fallback | no: always HTTP/1.1 | the same place | missing |
http_client.engine: apple | no | the same place (http_client) | platform |
download_detour (the old name) | different: in YAML it is via | router/src/syntax.rs (remote_rule_set) | — |
The source format with rule versions | present | router/src/options (parse_rule_set) | — |
Xray
| What | Status | Verdict |
|---|---|---|
domainStrategy: IPIfNonMatch/IPOnDemand | different: do: resolve at the right place in the list | — |
geosite:/geoip: with .dat | different: geosite.dat/geoip.dat are rule-sets of format: dat with a category in Xray syntax (cn, google@cn, !cn), matched by the rule-set engine; a rule refers to them with rule_set or with geosite:/geoip: by the set's name, there is no ext:file:code | — |
domainMatcher: mph | different: domains are in a succinct trie, as for .srs | — (design) |
geosite:/geoip: in rules from Xray subscriptions | no: subscriptions give only servers, routing rules are not imported | — |
The attrs conditions, user by email | no; auth_user — by user name | rarely needed |
Balancers, observatory | different: groups | — |