Proxy config field reference — Clash YAML vs sing-box JSON
The same setting in both formats, with the semantic difference spelled out. Most failed migrations are not missing fields — they are fields that exist in both formats, share a name, and mean something narrower in one of them.
Ports and entry points
| Concept | Clash / mihomo | sing-box |
|---|---|---|
| HTTP + SOCKS on one port | mixed-port: 7890 | inbounds[type=mixed], listen_port |
| Separate HTTP / SOCKS | port: / socks-port: | two inbounds: type: http, type: socks |
| TUN adapter | tun: block | inbounds[type=tun] |
| LAN exposure | allow-lan: true + bind-address | listen: "0.0.0.0" per inbound |
allow-lan: true without bind-address is the usual
"phone cannot connect" cause. On Windows the Windows Firewall does the same thing — the adapter
is up, the port is bound to localhost only.
DNS
| Concept | Clash / mihomo | sing-box |
|---|---|---|
| Enable DNS | dns.enable: true | dns.servers non-empty |
| Synthetic answers | enhanced-mode: fake-ip | no fake-ip concept — always resolves |
| Bypass list | fake-ip-filter | dns.rules → direct server |
| Bootstrap resolver | default-nameserver | not needed (servers addressed by IP or detour) |
| Per-outbound isolation | implicit | dns.independent_cache: true |
Clash can answer with a fake IP before resolving; sing-box always resolves.
That is why a config with 40 fake-ip-filter entries has no direct sing-box equivalent —
each entry becomes a dns.rules branch instead.
independent_cache matters more than it looks. Without it a domain
resolved for direct is reused for proxy, producing a split-tunnel DNS leak
that only shows up on sites whose answer differs by region.
TUN and routing
| Concept | Clash / mihomo | sing-box |
|---|---|---|
| Auto route | tun.auto-route | route.auto_detect_interface + tun.auto_route |
| Interface detection | tun.auto-detect-interface | route.auto_detect_interface |
| Stack | tun.stack: mixed / gvisor / system | tun.stack: mixed / gvisor / system |
| DNS hijack | tun.dns-hijack | protocol: dns route rule → dns-out |
| Block bypass | not exposed | tun.strict_route |
| MTU | tun.mtu | tun.mtu |
strict_route has no Clash equivalent. It is what stops apps from
ignoring the TUN adapter, and on Windows it closes the DNS-leak path. A migrated config that
leaks DNS where Clash did not is usually missing exactly this field.
auto-route without auto-detect-interface is accepted by both
formats and breaks on both. The route table gets an entry pointing at an interface that cannot
carry the traffic. Symptom is "connected, no internet" — never a config error.
Rules
| Concept | Clash / mihomo | sing-box |
|---|---|---|
| Inline rule | rules: ["DOMAIN-SUFFIX,x,DIRECT"] | route.rules[{domain_suffix, outbound}] |
| Remote list | rule-providers with behavior | route.rule_set, format: binary |
| List format | domain / ipcidr / classical | binary .srs or JSON source |
| Default action | MATCH,PROXY (must be last) | route.final |
| Skip DNS for IP rules | no-resolve | implicit |
behavior is the field that fails silently. A behavior: domain
provider loaded from a classical list parses, reports success, and matches nothing.
Check the first non-comment line of the source file: DOMAIN-SUFFIX, means it is classical.
Proxy nodes
| Field | Clash / mihomo | sing-box |
|---|---|---|
| VLESS flow | flow: xtls-rprx-vision | flow: xtls-rprx-vision |
| TLS SNI | servername (vmess) / sni (trojan) | tls.server_name (uniform) |
| Skip verification | skip-cert-verify: true | tls.insecure: true |
| uTLS fingerprint | client-fingerprint: chrome | tls.utls.fingerprint |
| Reality | reality-opts.public-key | tls.reality.public_key |
Clash splits the SNI field by protocol — servername for vmess,
sni for trojan. sing-box unifies everything under tls.server_name.
Copying a Clash node block into sing-box and only changing type is how you get a
TLS handshake failure against a valid certificate.
Validate before you debug
mihomo -t -f config.yaml # Clash / Clash Verge Rev profile
sing-box check -c config.json # sing-box
sing-box rule-set compile x.json # rule set before deploying
A passing check means the structure is valid. It says nothing about whether
auto-detect-interface is set, whether behavior matches the file, or whether
independent_cache is on. Those are the failures you are actually chasing.