Chained Proxies and Pinned Outbounds¶
Setting outbound on any Wind inbound pins that listener directly to a declared outbound and bypasses the router. Combining tunnel inbounds with socks outbounds lets you assemble multi-hop transports (such as carrying TUIC's QUIC packets over an upstream SOCKS5 UDP proxy) without modifying protocol implementations.
Pinned Outbound Semantics¶
- When an inbound specifies
outbound: <tag>, all flows accepted by that inbound are dispatched straight to that outbound without calling the router. - If the referenced tag does not exist, Wind fails at configuration resolution and never silently falls back to the default outbound.
- When
outboundis omitted, normal routing applies (forwarding to the first declared outbound in standalonewind).
Prerequisites for Manual Chaining¶
Keep two operational details in mind when wiring multi-hop chains manually:
- Use a fixed loopback port: Although
tunnelpermits port0(ephemeral OS allocation), downstream outbounds in standalonewind(such astuic.server_addr) require a concrete port, so assign a fixed loopback port (e.g.127.0.0.1:10900). - Deferred domain resolution:
tunnel.remote_addraccepts a domain, IPv4, or bracketed IPv6 with a non-zero port. Domains are not resolved bytunnel; they are handed verbatim to the pinned outbound (such as an upstream SOCKS5 server).
Example: Carrying TUIC over a SOCKS5 Upstream¶
The following standalone wind configuration routes local SOCKS5 traffic through tuic, while carrying tuic's QUIC UDP datagrams through a local UDP tunnel into an upstream SOCKS5 server supporting UDP ASSOCIATE. Replace all placeholder addresses and credentials before use:
inbounds:
- type: socks
tag: local
listen_addr: "127.0.0.1:1080"
outbound: tuic
- type: tunnel
tag: tuic-transport
listen_addr: "127.0.0.1:10900"
remote_addr: "tuic.example.com:8443"
network: udp
outbound: socks-upstream
outbounds:
- type: socks
tag: socks-upstream
server_addr: "socks.example.com:1080"
allow_udp: true
udp:
timeout: 8s
buffer_size: 2048
reconnect: true
initial_backoff: 500ms
max_backoff: 30s
- type: tuic
tag: tuic
server_addr: "127.0.0.1:10900"
sni: "tuic.example.com"
uuid: "00000000-0000-4000-8000-000000000001"
password: "change-this-password"
[[inbounds]]
type = "socks"
tag = "local"
listen_addr = "127.0.0.1:1080"
outbound = "tuic"
[[inbounds]]
type = "tunnel"
tag = "tuic-transport"
listen_addr = "127.0.0.1:10900"
remote_addr = "tuic.example.com:8443"
network = "udp"
outbound = "socks-upstream"
[[outbounds]]
type = "socks"
tag = "socks-upstream"
server_addr = "socks.example.com:1080"
allow_udp = true
[outbounds.udp]
timeout = "8s"
buffer_size = 2048
reconnect = true
initial_backoff = "500ms"
max_backoff = "30s"
[[outbounds]]
type = "tuic"
tag = "tuic"
server_addr = "127.0.0.1:10900"
sni = "tuic.example.com"
uuid = "00000000-0000-4000-8000-000000000001"
password = "change-this-password"
Startup Sequence and Security Notes¶
- Pin the local listener: Because
socks-upstreamappears first inoutbounds,localmust explicitly pinoutbound: tuic; otherwise unpinned traffic would go straight tosocks-upstream. - Staged startup: Wind builds
socks-upstreamand launches the pinnedtuic-transportUDP tunnel first, then establishes thetuicQUIC session, and finally openslocal. If startup is cancelled or fails midway, the early UDP socket is automatically released. - Unchanged TLS verification: Even though
tuictransmits UDP datagrams to127.0.0.1:10900, TLS SNI and certificate verification still targettuic.example.com. - Reconnect behavior: With
udp.reconnect: true, a dropped SOCKS5 control connection triggers exponential backoff frominitial_backoffup tomax_backoff. Datagrams arriving during reconnection are dropped and recovered by the inner QUIC transport.
Relation to tuic-client¶
tuic-client's upstream proxy configuration automates this chain for both Quinn and Quiche backends. Unlike manual standalone wind configs, tuic-client holds an OS-assigned ephemeral loopback port and restricts its internal tunnel to the pre-bound local TUIC socket, whereas a generic tunnel inbound accepts multiple local peers.