Skip to content

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: wg0

The key is the outbound's name. Under it there is exactly one protocol block and the shared blocks.

Protocols ​

BlockWhere it connects
directDirectly
socks, httpThrough a SOCKS5/4 or HTTP proxy
shadowsocks, vless, trojan, anytls, shadowtlsThrough a proxy protocol over TCP
hysteria, hysteria2, tuicThrough 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 ​

BlockProtocols
dialall
tlshttp, vless, trojan, anytls, shadowtls, hysteria, hysteria2, tuic
transportvless, trojan
muxvless, trojan, shadowsocks
reloadall

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 dial from defaults.
  • The other blocks (tls, transport, mux, the protocol block) go only to outbounds that already have such a block. tls, transport and mux in defaults are written at the top level (defaults has no protocol) and are merged with the block inside the outbound's protocol. In the example proxy-de gets utls, while direct stays without TLS.
  • The merge goes field by field, to any depth; the outbound's own value wins.
  • defaults also 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.

GPL-3.0-or-later