Skip to content
Edit this page

Inbounds Overview

Inbounds accept local or remote client traffic and hand connections to the ClashRS routing dispatcher. You can configure them via:

  1. Top-level port shorthands (port, socks-port, mixed-port, redir-port, tproxy-port)
  2. Named listeners for full multi-protocol, multi-port control
  3. Top-level tunnels for fixed-target TCP/UDP forwarding
  4. inbound-providers for dynamic file or HTTP listener lists
  5. tun for L3 transparent proxying

Top-Level Port Shorthands

Each top-level port field (type Port) is converted into a named listener that inherits top-level bind-address, allow-lan, and routing-mark:

Top-Level Key Alias Generated Listener Name Inbound Type Implicit Defaults Required Feature
port http_port HTTP-IN http — Built-in
socks-port — SOCKS-IN socks udp: true Built-in
mixed-port — MIXED-IN mixed udp: true Built-in
redir-port — REDIR-IN redir — redir (standard)
tproxy-port — TPROXY-IN tproxy udp: true, dns-hijack: true tproxy (standard)

If bind-address is left at its default (0.0.0.0) and top-level ipv6: true, shorthand listeners automatically upgrade to dual-stack ::.

Supported listeners Types

Type Transport Platform / Feature Reference
http TCP All / built-in HTTP & Mixed
mixed TCP + SOCKS5 UDP All / built-in HTTP & Mixed
socks TCP + UDP (UDP_ASSOCIATE) All / built-in SOCKS5
tproxy (or t-proxy) TCP + UDP Linux, Android / tproxy Transparent Proxy
redir TCP Linux / redir Transparent Proxy
tunnel TCP / UDP All / built-in Tunnel
shadowsocks TCP + UDP All / shadowsocks Proxy Protocols
anytls TCP + UoT v2 All / built-in Proxy Protocols
hysteria2 QUIC (UDP) All / built-in Proxy Protocols

Common listeners Fields

Every entry in listeners shares these base fields:

Key Type Required Default Description
name string Yes — Listener name.
type string Yes — Inbound type from the table above.
listen BindAddress Yes — Listen IP (*, localhost, ::, [::], or IP literal).
port u16 Yes — Listen port (integer).
allow-lan bool No false Allow connections from non-local addresses (currently not enforced on tunnel and tproxy).
fw-mark SocketMark No None Linux/Android SO_MARK propagated to Session.so_mark.
listeners:
  - name: local-mixed
    type: mixed
    listen: 127.0.0.1
    port: 7890
    allow-lan: false

Deduplication & Authentication

  • Precedence: listeners entries are registered first, followed by tunnels, and finally top-level port shorthands. Identical entries are deduplicated with a warning (note that name is part of equality, so listeners with different names on the same port will conflict at bind time).
  • Global authentication: Top-level authentication: ["user:pass"] applies to http, socks, and mixed listeners (both shorthand and listeners[]). Protocol inbounds (shadowsocks, anytls, hysteria2) use their own password / users credentials instead.
  • Hot user updates: For shadowsocks, anytls, and hysteria2, updating users via inbound-providers reloads credentials in place without restarting the listening socket. See Providers.