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.
[[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
| On | dialer-proxy may name | Effect |
|---|---|---|
a [[proxy]] | a proxy or a proxy group | every connection through this proxy goes through the target first |
a [[proxy-group]] | a proxy only | every 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.
DIRECTandREJECTare not valid targets; a name that is not a proxy or a group is rejected withUnknown dialer-proxy '<name>' for '<proxy>'. - A group as target must contain proxies only. If a proxy's
dialer-proxynames a group withDIRECTorREJECTamong its members, the profile is rejected. - A group's own
dialer-proxymust be a concrete[[proxy]], not a group, notDIRECTorREJECT, 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(unlessudp = false), orsocks5andvmesswithudp = 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 adialer-proxy. - No cycles.
a → b → a, and loops through groups (a proxy whose entry is a group that contains the proxy), are rejected withCircular 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:
[[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-proxyreplaces a member's owndialer-proxyfor connections made through the group. - A member used directly, by a rule or
global-proxy, keeps its own setting.exit-aabove goes throughentryonly when it is reached throughchained-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:
- It starts from the proxy the rule chose and follows its
dialer-proxy, then the entry's owndialer-proxy, and so on, so chains of three or more hops work. - 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
selectgroup, the fastest member ofurl-test, the first healthy member offallback. - For
load-balance,round-robinrotates the entry with each connection, butconsistent-hashingalways 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 proxy | UDP path |
|---|---|
vmess, vless, trojan | UDP travels inside the proxy's TCP connection, which follows the whole chain |
hysteria2, tuic | QUIC packets go through the entry's UDP relay |
ss | UDP packets reach the Shadowsocks server through the entry's UDP relay |
socks5 | the 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:
[[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:
[[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
- Find the failing hop: test the entry alone in Global mode, then the exit alone (without
dialer-proxy), then the chain. requires UDP-capable dialer-proxy: the entry of a Hysteria2 or TUIC proxy cannot relay UDP. Setudp = trueon a SOCKS5 or VMess entry, or pick another entry.requires concrete proxy members: removeDIRECTandREJECTfrom the group used as entry.- A chained group's members show as failed: their health checks go through the group's entry, so check that the entry itself works.
- UDP fails through a chain while TCP works: the entry cannot relay UDP; see UDP in a chain.
See also Proxies and Proxy Groups.
