Skip to content

inbounds — inbounds ​

An inbound accepts connections: it listens on an address and parses the client's protocol. What to do with a connection next is decided by the routing rules: sniffing and DNS hijacking are rule actions, not properties of the inbound.

yaml
inbounds:
  local:
    mixed:
      listen: 127.0.0.1:1080
  socks-lan:
    socks:
      listen: 192.168.1.1:1080
      users:
        - username: alice
          password: secret

The key is the inbound's name. Under it there is exactly one protocol block and, if the protocol takes them, shared blocks.

Protocols ​

BlockWhat it accepts
mixedAn HTTP proxy and SOCKS on one port
httpAn HTTP proxy
socksSOCKS4/4a/5
directConnections as they are, with a given destination address
tproxyLinux transparent interception (TPROXY), with auto_nft
redirectLinux transparent TCP interception through redirect
tunA TUN device with auto_route and auto_redirect
shadowsocks, vless, trojan, anytls, shadowtlsThe server side of proxy protocols
hysteria, hysteria2, tuicProxy protocols over QUIC
mtprotoThe Telegram proxy (MTProxy)

The fields of each protocol are in Protocols. The listening address is one string, listen: host:port; the shared listener fields are in listen.

A protocol that is not in this build is an error listing the available ones; a protocol that does not exist at all (vmess, naive, …) is unknown inbound type `vmess` .

Shared blocks ​

BlockProtocols
tlshttp, mixed, trojan, vless, anytls, hysteria, hysteria2, tuic
transporttrojan, vless
muxvless, trojan, shadowsocks
listenerall
reloadall

An inbound has no dial block: its socket parameters are in the listener block, next to the protocol block. An extra block is the error inbound `x`: `socks` takes no `tls` block.

Example: VLESS with TLS and WebSocket.

yaml
inbounds:
  vless-in:
    vless:
      listen: 0.0.0.0:443
      users:
        - name: alice
          uuid: bf000d23-0752-40b4-affe-68f7707a9661
      tls:
        certificate_path: cert.pem
        key_path: key.pem
      transport:
        ws:
          path: /ws

Blocks: tls, transports, mux, listener, reload.

Inbound names ​

An inbound's name is used in the inbound condition of route and dns rules, in explain --inbound, and in the dashboard. Inbound names are a separate namespace: an inbound may have the same name as an outbound. A name that does not exist in an inbound condition is a build error: route names inbound `typo`, which is not in the configuration.

The inbounds that dns.listen creates get the first free names out of dns, dns-1, … (see DNS).

Reload ​

On reload an inbound whose settings did not change keeps working without interruption. A changed inbound is rebuilt: the new one takes over the old one's socket if the address is the same. What happens to already accepted connections is set by reload.

A change of users alone does not rebuild the inbound: for http, mixed, socks, shadowsocks, trojan, anytls, hysteria, hysteria2, tuic, vless and mtproto the new list applies to new connections, and the open ones keep working. An invalid list (for example, a key that does not fit the method of shadowsocks) rejects the whole reload.

GPL-3.0-or-later