With a single proxy node, a Clash proxy group is just a selector. But with multiple nodes, proxy groups unlock their real value: automatic latency-based selection, seamless failover, load distribution across nodes, and even multi-hop chains for advanced routing scenarios. This article covers all five of Clash's proxy group types — their design rationale and production configurations.
The Five Proxy Group Types
Clash supports five proxy group types, each suited to a different traffic management goal:
| Type | Selection Method | Best For |
|---|---|---|
select | Manual user selection | Primary proxy group; user switches manually |
url-test | Auto-select lowest latency | Multiple nodes; always use the fastest |
fallback | Try in order; use first available | High availability; auto-switch on node failure |
load-balance | Round-robin across nodes | Spread concurrent connections; raise bandwidth ceiling |
relay | Chain nodes in sequence | Multi-hop routing; hide exit IP |
url-test: Automatic Best-Node Selection
A url-test group periodically sends HTTP requests to a test URL, measures each node's latency, and automatically switches to the lowest-latency node. interval controls how often tests run. tolerance sets the switching threshold — only switch when the current node's latency exceeds the best node's by more than tolerance ms, preventing unnecessary flapping.
proxy-groups: - name: Auto-Select type: url-test proxies: - node-us-01 - node-eu-01 - node-jp-01 url: https://www.gstatic.com/generate_204 interval: 300 # Test every 5 minutes tolerance: 50 # Switch only if latency delta exceeds 50ms
fallback: High-Availability Switching
Unlike url-test, fallback doesn't pick the fastest — it uses the first available node in order. Only when the current node fails the health check (timeout or unreachable) does it move to the next entry in the list. This is perfect for primary/backup setups: use node A normally; automatically switch to node B if A goes down.
proxy-groups: - name: Primary-Backup type: fallback proxies: - node-primary # Used first - node-backup-1 # Auto-switch if primary fails - node-backup-2 # Third option url: https://www.gstatic.com/generate_204 interval: 60
load-balance: Spread Connections Across Nodes
A load-balance group distributes concurrent connections across multiple nodes, potentially raising aggregate throughput. Clash supports two strategy options:
- consistent-hashing: all connections to the same destination domain/IP always use the same node. Ideal for services requiring IP consistency (logins, streaming sessions).
- round-robin: each new connection rotates through the node list in turn. Most even distribution; best for stateless requests like bulk downloads.
proxy-groups: - name: Load-Balance type: load-balance strategy: consistent-hashing proxies: - node-a - node-b - node-c url: https://www.gstatic.com/generate_204 interval: 300
relay: Multi-Hop Proxy Chains
relay is Clash's most specialized group type. Traffic passes through nodes in the order listed in proxies — similar to Tor's multi-hop design. The final exit IP is the last node's IP. Common use cases include: routing through a nearby node first for reduced initial latency, then exiting through a geographically different node; or obscuring the true exit source by chaining multiple hops.
proxy-groups: - name: Relay-Chain type: relay proxies: - node-hop-1 # Traffic enters here first - node-hop-2 # Then exits from here
Combining Group Types: A Production Template
In practice, proxy group types are best combined: a top-level select group lets the user choose between "Auto-Select" and a manually pinned node. Underneath, url-test and fallback subgroups provide automation while preserving manual override capability.
proxy-groups: # Top-level manual selector - name: Proxy type: select proxies: - Auto-Select - Primary-Backup - node-us-01 # Can also pin a specific node # Auto latency sub-group - name: Auto-Select type: url-test proxies: - node-us-01 - node-eu-01 - node-jp-01 url: https://www.gstatic.com/generate_204 interval: 300 tolerance: 50 # Primary/backup sub-group - name: Primary-Backup type: fallback proxies: - node-us-01 - node-eu-01 url: https://www.gstatic.com/generate_204 interval: 60