Choosing Between Clash’s Three Automatic Proxy Groups
Choose url-test to prefer nodes with lower measured latency; choose fallback to keep a primary node and switch only when it fails; choose load-balance to distribute separate connections across multiple nodes. All three groups can perform health checks—the difference is how they select an egress node based on the results.
| Type | How It Chooses | Best For |
|---|---|---|
url-test | Compares probe latency; tolerance can reduce switching | Everyday browsing when a fixed egress isn’t needed |
fallback | Selects the first available node in the list | Primary and backup routes with a clear priority order |
load-balance | Distributes connections across available nodes according to the strategy | Multiple independent tasks that don’t need to share one egress |
The examples below use the mihomo core from the Clash Meta family. 线路-A, 线路-B, and 线路-C are example names; before merging the YAML, replace the names in each group’s proxies list with nodes defined in your current configuration. Put all three entries in the same top-level proxy-groups list—don’t repeat the top-level key for each group.
url-test: Choose a Node by Latency; Use tolerance to Control Switching
url-test compares the time each node takes to reach the same probe URL. It does not use ICMP ping or measure download speed. The results help compare response times to that address during the same period; the node that reaches the probe URL fastest may not be the fastest for every website.
- name: Lowest Latency
type: url-test
proxies:
- Line-A
- Line-B
- Line-C
url: https://www.gstatic.com/generate_204
interval: 300
tolerance: 50
lazy: false
How a 50 ms Tolerance Works
While the current node is available, tolerance lets the core keep using it even if its latency is slightly higher. Suppose A is in use and the probe results are 126 ms for A and 101 ms for B. B is only 25 ms faster, so a 50 ms tolerance is enough to keep A. If the next round shows 190 ms for A and 101 ms for B, the 89 ms difference exceeds the tolerance. If B is the fastest available node in that round, the group can switch to B. These figures illustrate how the decision works; they are not measured results for any particular route.
interval: 300 is measured in seconds, so it schedules a regular probe every 5 minutes. tolerance: 50 is measured in milliseconds. Tolerance is neither a timeout threshold nor a way to fix unavailable nodes. Don’t mistake the interval for milliseconds to make the group switch faster, or adjust tolerance as if it were the probe interval.
fallback: Select Primary and Backup Routes in List Order
fallback cares about whether a node is available and where it appears in the list—not its latency ranking. Put the route you prefer to use at the top. Even if a backup route has lower probe latency, the group keeps using the preferred route as long as it is considered available.
- name: Primary and Backup
type: fallback
proxies:
- Line-A
- Line-B
- Line-C
url: https://www.gstatic.com/generate_204
interval: 120
lazy: false
- Primary route available: A takes 180 ms to probe and B takes 90 ms. If A is available, A is still selected.
- Primary route fails: After the health status updates, if A is unavailable and B is available, new connections use B. If B is unavailable too, the group checks C.
- Primary route recovers: Once A is marked available again, new connections can return to A. Existing connections won’t migrate; disconnected sessions must be reconnected by the application.
interval: 120 schedules a regular probe every 2 minutes. It doesn’t mean the group will switch a fixed number of seconds after a failure; the timing depends on when a probe starts and what it reports. If the preferred route is slow for a particular website but still passes the probe, fallback will keep selecting it—that’s expected. To switch routes based on relative latency, use url-test.
load-balance: Distribute Connections; strategy Determines Routing
load-balance is useful when multiple independent connections are active. It selects an egress for each new connection; it doesn’t split a single TCP connection across multiple nodes or guarantee that one download will match the combined bandwidth of all nodes.
- name: Distribute Connections
type: load-balance
strategy: consistent-hashing
proxies:
- Line-A
- Line-B
- Line-C
url: https://www.gstatic.com/generate_204
interval: 300
lazy: false
consistent-hashing: Selects a node by mapping the destination to a node. When the candidate nodes and their availability remain stable, the same destination key tends to use the same egress. For IP-based destinations, the mapping can use the destination IP; for domain names, subdomains under the same registrable domain are generally mapped to the same destination key. So visiting two subdomains on the same site won’t necessarily use two different nodes.round-robin: Setstrategyto this value to rotate new connections across available nodes. Browsers reuse existing connections, so refreshing a page repeatedly doesn’t necessarily create new connections each time. Long-lived and short-lived connections can also generate very different amounts of traffic, even if their counts are similar.
Route Traffic to Proxy Groups: First Check Which Group Matches
Defining a proxy group doesn’t automatically route application traffic to it. In rule mode, the core checks rules in order; the group referenced by the matching rule selects the egress. The examples below use three reserved example domains to show the syntax—replace them with your actual service domains. The direct-connection fallback is included only to illustrate rule placement; when merging, keep whatever fallback behavior your existing configuration requires.
mode: rule
rules:
- DOMAIN,browse.example,Lowest Latency
- DOMAIN,office.example,Primary and Backup
- DOMAIN,jobs.example,Distribute Connections
- MATCH,DIRECT
DOMAIN matches only the hostname you specify. To include subdomains, use DOMAIN-SUFFIX as needed. Place specific rules before broader rules that could match first, and never after MATCH. If the client is in Global mode, switch to Rule mode, then verify the rules in the connection log.
Probe URLs and service domains serve different purposes. A probe URL checks whether a route can complete the probe and how long it takes; service domains determine how real traffic is routed. If every node times out against the same probe URL, don’t assume all nodes are down. Check whether the probe URL is reachable, and use actual service connections to see whether the issue is specific to the probe target.
Verify the Result: Separate Probe Results, Current Egress, and Existing Connections
Check the configuration actually running in the client and the records for new connections. The latency panel mainly shows probe results; on its own, it doesn’t prove that a recent browser request used the intended group. You don’t need to enable TUN just to test proxy groups: the system proxy and TUN determine how traffic enters the core, while proxy groups decide where traffic goes after that.
- Check the active configuration first. Confirm which configuration is enabled on the client’s configuration page, then check that all three groups appear on the proxy page. Subscription updates can overwrite YAML edits. If the client supports overrides, use its documented override method and verify the group names and rules again after the next update.
- Then check candidate status. Record probe results and availability for two rounds on the proxy page. The examples explicitly set
lazy: falseso the group probes according to its configuration even while idle. Groups using lazy checks may not keep updating results as expected when they haven’t been used for a while. If candidates come fromproxy-providersviause, check the relevant provider’shealth-checksettings; don’t assume provider nodes have been checked based only on the group’s probe fields. - Use a new connection to check the egress. Make a request to a service domain that clearly matches a rule, then check the matched rule, proxy group, and selected node in the connection details. To test
round-robin, create several separate connections rather than judging rotation from one reused browser session. To test failback, wait until the primary node is marked available again, then compare new connections.
Troubleshoot in this order: rule match → candidate availability → group routing. If the wrong rule matches, fix the rules first. If all candidates are unavailable, check the probe target and routes. If candidates are available but the egress is unexpected, check tolerance, list order, or strategy. This avoids changing several fields at once and makes it easier to identify what caused the result.