English
outbounds — outbounds
An outbound is a way to establish an outgoing connection: directly or through a proxy server. An outbound describes one connection; choosing between several outbounds is the job of groups.
yaml
outbounds:
direct:
direct:
proxy-de:
vless:
server: de.example.com:443
uuid: bf000d23-0752-40b4-affe-68f7707a9661
flow: xtls-rprx-vision
tls:
sni: www.example.com
utls:
fingerprint: chrome
reality:
public_key: jNXHt1yRo0vDuchQlIP6Z0ZvjT3KtzVI-T4E7RoLJS0
short_id: ab12
wg-kernel:
direct:
dial:
interface: wg0The key is the outbound's name. Under it there is exactly one protocol block and the shared blocks.
Protocols
| Block | Where it connects |
|---|---|
direct | Directly |
socks, http | Through a SOCKS5/4 or HTTP proxy |
shadowsocks, vless, trojan, anytls, shadowtls | Through a proxy protocol over TCP |
hysteria, hysteria2, tuic | Through a proxy protocol over QUIC |
The protocol fields are in Protocols. The server address is one string, server: host:port.
There is no block outbound: refusing is the route action to: block. There are no groups (the sing-box selector, urltest) among the outbounds either: they are in the groups section. Writing block: or group: as a protocol gives an error with a hint.
Shared blocks
| Block | Protocols |
|---|---|
dial | all |
tls | http, vless, trojan, anytls, shadowtls, hysteria, hysteria2, tuic |
transport | vless, trojan |
mux | vless, trojan, shadowsocks |
reload | all |
Descriptions: dial, tls, transports, mux, reload.
dial.detour is the name of an outbound or group through which the connection to the server goes (a chain).
Shared values: defaults
defaults is a reserved name in outbounds. It is not an outbound but a set of blocks that are merged with the blocks of every outbound:
yaml
outbounds:
defaults:
dial:
interface: eth0
connect_timeout: 5s
tls:
utls:
fingerprint: firefox
direct:
direct:
proxy-de:
trojan:
server: de.example.com:443
password: secret
tls:
sni: de.example.com- Every outbound gets
dialfromdefaults. - The other blocks (
tls,transport,mux, the protocol block) go only to outbounds that already have such a block.tls,transportandmuxindefaultsare written at the top level (defaultshas no protocol) and are merged with the block inside the outbound's protocol. In the exampleproxy-degetsutls, whiledirectstays without TLS. - The merge goes field by field, to any depth; the outbound's own value wins.
defaultsalso applies to subscription servers, but not to groups.
How an outbound learns the server address
If server is a domain name, it is resolved by the built-in DNS according to the dns.rules rules with the outbound condition, see Resolvers for outbounds. This way all DNS settings stay in the dns section. There are no dial.domain_resolver and dial.domain_strategy fields: loading ends with an error that points to dns.rules.
Reload
An outbound whose settings did not change is kept on reload, together with the connections opened through it. A changed outbound is rebuilt; by default the connections through the old one are closed (TCP) or moved to the new one (UDP), see reload.