Inbounds
inbounds is the array of listening services. Unlike Xray-core there is no nested settings block: each entry is a flat object — the type / tag envelope below plus the selected type's own fields merged at the same level. The envelope is decoded first, then the remaining keys are decoded into the option struct registered for type, with unknown fields rejected.
Envelope
| Field | Type | Default | Allowed values | Description |
|---|---|---|---|---|
type | string | — | tun | redirect | tproxy | direct | socks | http | mixed | shadowsocks | vmess | trojan | naive | shadowtls | vless | anytls | hysteria | tuic | hysteria2 | Inbound type. Selects which option struct the rest of the object is decoded into. An unregistered value fails at startup with "unknown inbound type". |
tag | string | — | — | Unique name for this inbound. Referenced by routing rules (inbound) and by log lines. |
Source: option/inbound.go:18-22 · pinned at v1.13.15 (3708fa1)
Per-type fields are documented on the protocol pages: TUN, Redirect & TProxy, Direct, HTTP & SOCKS (also mixed), Shadowsocks, VMess, Trojan, Naive, VLESS, AnyTLS, Hysteria2, TUIC.
Shared listen fields (ListenOptions)
Every socket-based inbound embeds ListenOptions; the fields appear at the same flat level as the envelope.
| Field | Type | Default | Allowed values | Description |
|---|---|---|---|---|
listen | *badoption.Addr | — | — | Address to bind, e.g. "::" or "127.0.0.1". |
listen_port | uint16 | — | — | Port to listen on. |
bind_interface | string | — | — | Network interface to bind the listener to. |
routing_mark | FwMark | — | — | SO_MARK (fwmark) to set on the listening socket. Linux only. |
reuse_addr | bool | false | true | false | Set SO_REUSEADDR on the listener. |
netns | string | — | — | Network namespace to listen in (name or path). Linux only. |
disable_tcp_keep_alive | bool | false | true | false | Turn TCP keep-alive off for accepted connections. |
tcp_keep_alive | badoption.Duration | — | — | Keep-alive idle period before probes start. Duration string, e.g. "15m". |
tcp_keep_alive_interval | badoption.Duration | — | — | Interval between keep-alive probes. Duration string. |
tcp_fast_open | bool | false | true | false | Enable TCP Fast Open on the listener. |
tcp_multi_path | bool | false | true | false | Enable Multipath TCP (requires Go MPTCP support on the platform). |
udp_fragment | *bool | false | true | false | Allow fragmenting UDP packets larger than the MTU instead of dropping them. |
udp_timeout | UDPTimeoutCompat | — | — | Idle timeout for UDP NAT entries. Duration string; the effective default depends on the sniffed protocol. |
detour | string | — | — | Forward accepted connections straight into another inbound, addressed by its tag. |
proxy_protocol | bool | — | — | Deprecated and removed: PROXY-protocol header support no longer exists; setting it is an error. |
proxy_protocol_accept_no_header | bool | — | — | Deprecated and removed together with proxy_protocol. |
Source: option/inbound.go:66-88 · pinned at v1.13.15 (3708fa1)
Minimal example
{
"inbounds": [
{
"type": "mixed",
"tag": "mixed-in",
"listen": "127.0.0.1",
"listen_port": 2080
}
]
}Notes
- The strict unmarshaler applies inside inbound entries too: a typo in any field name is a startup error, not silently ignored.
- The legacy sniffing fields (
sniff,sniff_override_destination,sniff_timeout,domain_strategy,udp_disable_domain_unmapping) were deprecated in 1.11.0 and removed in 1.13.0 — supplying them is an error pointing to the rule-actions migration. Sniffing now lives in route rules. shadowsocksris still registered but only as a stub that errors: ShadowsocksR support was removed in sing-box 1.6.0.hysteria,tuicandhysteria2require a build with thewith_quictag (official release binaries include it).
Cross-core notes
- Xray-core nests protocol fields in a
settingsobject and keeps sniffing per-inbound. See Xray Inbounds. - mihomo uses individual root keys (
port,socks-port,mixed-port, …) plus alistenerslist. See HTTP & SOCKS and Redirect & TProxy.
Source: option/inbound.go:18-22 · v1.13.15 (3708fa1)
