Skip to content
Edit this page

Transparent Proxy Inbounds (TProxy & Redir)

In addition to TUN, ClashRS supports kernel-level transparent proxying via TProxy (TCP + UDP) and Redir (TCP).

TProxy Inbound (type: tproxy)

  • Platforms: Linux and Android only (logs a warning and skips on other platforms).
  • Feature: tproxy (enabled in standard / default builds).
  • Transport: TCP and UDP (IP_TRANSPARENT).
  • Aliases: Both type: tproxy and type: t-proxy are accepted.

Fields

In addition to common listener fields (name, listen, port, allow-lan, fw-mark):

Key Type Default Description
udp bool true Accepted in config; at runtime TproxyInbound always handles UDP.
dns-hijack bool true Hijack TProxy UDP DNS traffic to the built-in DNS resolver.
tproxy-port: 7893
routing-mark: 6666
listeners:
  - name: tproxy-in
    type: tproxy
    listen: 0.0.0.0
    port: 7893
    udp: true
    dns-hijack: true
    fw-mark: 6666

Loop Avoidance on Linux

Always set top-level routing-mark (or fw-mark) and exclude that mark in your iptables / nftables TPROXY rules so outbound connections generated by ClashRS are not redirected back into tproxy-port.

Redir Inbound (type: redir)

  • Platforms: Linux only (uses SO_ORIGINAL_DST / IP6T_SO_ORIGINAL_DST).
  • Feature: redir (enabled in standard / default builds).
  • Transport: TCP only.
  • Type-specific fields: None beyond common listener fields.
redir-port: 7892
routing-mark: 6666
listeners:
  - name: redir-in
    type: redir
    listen: 0.0.0.0
    port: 7892
    allow-lan: true
    fw-mark: 6666