Skip to content

Proxy Chains ​

dialer-proxy makes a proxy reach its server through another proxy. The connection then goes application → Specola → entry → exit → destination. The exit server sees the entry's address, not yours.

toml
[[proxy]]
name = "entry"
type = "socks5"
server = "entry.example.org"
port = 1080

[[proxy]]
name = "exit"
type = "trojan"
server = "exit.example.org"
port = 443
password = "change-me"
dialer-proxy = "entry"

[general]
route-mode = "global"
global-proxy = "exit"

Test each proxy on its own in Global mode before you chain them. A chain fails when any hop fails, and the error does not always say which one.

Where to write it ​

Ondialer-proxy may nameEffect
a [[proxy]]a proxy or a proxy groupevery connection through this proxy goes through the target first
a [[proxy-group]]a proxy onlyevery member, when chosen through this group, goes through that proxy

Write it with a hyphen. dialer_proxy is rejected with Use 'dialer-proxy' (hyphen), not 'dialer_proxy'.

Rules the profile is checked against ​

  • The target must exist. DIRECT and REJECT are not valid targets; a name that is not a proxy or a group is rejected with Unknown dialer-proxy '<name>' for '<proxy>'.
  • A group as target must contain proxies only. If a proxy's dialer-proxy names a group with DIRECT or REJECT among its members, the profile is rejected.
  • A group's own dialer-proxy must be a concrete [[proxy]], not a group, not DIRECT or REJECT, and not one of the group's members. Such a group must contain proxies only.
  • Hysteria2 and TUIC need a UDP-capable entry. They run over QUIC, so their entry must relay UDP: ss, vless, hysteria2, tuic, trojan (unless udp = false), or socks5 and vmess with udp = true. When the entry is a group, every member must qualify. The same check applies when a Hysteria2 or TUIC proxy is a member of a group that has a dialer-proxy.
  • No cycles. a → b → a, and loops through groups (a proxy whose entry is a group that contains the proxy), are rejected with Circular dialer-proxy reference: ....

The check counts VLESS as UDP-capable even with flow = "xtls-rprx-vision", which carries no UDP. Do not use a Vision proxy as the entry of Hysteria2 or TUIC: the profile loads, but connections fail.

A group with an entry proxy ​

A group's dialer-proxy puts one entry in front of all its members:

toml
[[proxy]]
name = "entry"
type = "socks5"
server = "entry.example.org"
port = 1080

[[proxy]]
name = "exit-a"
type = "trojan"
server = "a.example.org"
port = 443
password = "change-me"

[[proxy]]
name = "exit-b"
type = "trojan"
server = "b.example.org"
port = 443
password = "change-me"

[[proxy-group]]
name = "chained-exits"
type = "url-test"
proxies = ["exit-a", "exit-b"]
dialer-proxy = "entry"
url = "https://www.gstatic.com/generate_204"
interval = 300
  • The group's dialer-proxy replaces a member's own dialer-proxy for connections made through the group.
  • A member used directly, by a rule or global-proxy, keeps its own setting. exit-a above goes through entry only when it is reached through chained-exits.
  • Health checks of the members go through the group's entry too, the same way the group's connections do.

How a chain is resolved ​

Specola builds the chain again for each new connection:

  1. It starts from the proxy the rule chose and follows its dialer-proxy, then the entry's own dialer-proxy, and so on, so chains of three or more hops work.
  2. When a hop names a group, the group picks a member at that moment, the same way it does for rules: the chosen member of a select group, the fastest member of url-test, the first healthy member of fallback.
  3. For load-balance, round-robin rotates the entry with each connection, but consistent-hashing always picks the same healthy member, because a chain hop has no destination to hash.

Changing the member of a select group affects new connections only. Connections already open keep their path.

UDP in a chain ​

Exit proxyUDP path
vmess, vless, trojanUDP travels inside the proxy's TCP connection, which follows the whole chain
hysteria2, tuicQUIC packets go through the entry's UDP relay
ssUDP packets reach the Shadowsocks server through the entry's UDP relay
socks5the control connection follows the chain; the UDP packets reach the relay address the server returns through the entry's UDP relay

UDP never goes around the entry. When the entry cannot relay UDP (an http or anytls proxy, or a socks5 or vmess proxy without udp = true), UDP through the chained proxy fails while TCP keeps working. Only Hysteria2 and TUIC are checked for this when the profile loads.

Examples ​

Hysteria2 through a Shadowsocks entry:

toml
[[proxy]]
name = "ss-entry"
type = "ss"
server = "entry.example.org"
port = 8388
cipher = "aes-128-gcm"
password = "change-me"

[[proxy]]
name = "hy2-exit"
type = "hysteria2"
server = "exit.example.org"
port = 443
password = "change-me"
dialer-proxy = "ss-entry"

An exit reached through whichever entry you pick in a select group:

toml
[[proxy]]
name = "entry-a"
type = "socks5"
server = "a.example.org"
port = 1080

[[proxy]]
name = "entry-b"
type = "http"
server = "b.example.org"
port = 8080

[[proxy-group]]
name = "entry"
type = "select"
proxies = ["entry-a", "entry-b"]

[[proxy]]
name = "exit"
type = "vless"
server = "exit.example.org"
port = 443
uuid = "b1479ae4-f64b-4b27-bdab-4fb0f4ecdba9"
tls = { server-name = "exit.example.org" }
dialer-proxy = "entry"

The entry group may not contain DIRECT. To let the exit sometimes connect directly, add a second exit proxy without dialer-proxy and choose between the two in a group.

Troubleshooting ​

  1. Find the failing hop: test the entry alone in Global mode, then the exit alone (without dialer-proxy), then the chain.
  2. requires UDP-capable dialer-proxy: the entry of a Hysteria2 or TUIC proxy cannot relay UDP. Set udp = true on a SOCKS5 or VMess entry, or pick another entry.
  3. requires concrete proxy members: remove DIRECT and REJECT from the group used as entry.
  4. A chained group's members show as failed: their health checks go through the group's entry, so check that the entry itself works.
  5. UDP fails through a chain while TCP works: the entry cannot relay UDP; see UDP in a chain.

See also Proxies and Proxy Groups.