Clash Proxy Groups: url-test, fallback & load-balance Explained
Learn how Clash select, url-test, fallback, and load-balance groups choose proxies, with key settings and editable proxy-groups examples.
Understand rules, proxy groups, and proxies
In a Clash config, rules determine which proxy group handles a connection. proxy-groups determine which proxies or nested groups are available as exit points, while proxies and proxy-providers supply the candidate proxies. If a rule matches but traffic exits through the wrong proxy, check which group the rule targets, then see which member is selected in that group—not just the proxy list.
A group's type determines how it selects a member: select lets you choose manually; url-test selects automatically based on measured latency; fallback uses the first available member in the list; and load-balance distributes connections across available proxies. Any of these groups can be a rule target, but automatic selection does not modify subscription proxies or change rule matching order.
| Type | Selection basis | Best for |
|---|---|---|
select | Member selected manually in the client | Keeping a manually chosen exit and a direct-connection option |
url-test | Lower measured latency | Automatically choosing a responsive proxy for everyday browsing |
fallback | First available member in the list | Using a preferred proxy and switching when it fails |
load-balance | Configured distribution strategy and proxy availability | Distributing separate connections across multiple proxies |
select: Choose the exit proxy manually
select is typically placed between rules and other proxy groups. For example, a rule can target a group called “Manual Select” that lists “Auto Select,” “Failover,” individual proxies, and DIRECT. This lets you change the exit proxy from the client's “Proxies” page without editing rules. DIRECT connects without a proxy; adding it to the group gives you a clear way to compare proxied and direct connections.
select does not switch members based on latency. If the list includes both an automatic group and individual proxies, selecting “Auto Select” lets the nested url-test group choose the specific proxy. The client's current selection may need to be checked again after a subscription update or group rename. After updating the config, confirm that the group members still exist, then verify the actual exit proxy.
url-test: Select by measured latency, not bandwidth
url-test uses url to set the test address and interval to set how often to run checks, in seconds. For example, interval: 300 schedules a check every 300 seconds. The latency shown by the client comes from the test request; it is not download speed and does not, by itself, indicate video throughput. Use an address that returns a response reliably. This example uses the commonly used https://www.gstatic.com/generate_204. If your network or proxies cannot reach it, replace it with a lightweight address you know is accessible; otherwise, the latency display may keep showing failures.
tolerance: 50 sets a 50 ms selection tolerance to reduce switching between proxies with similar latency. It is not a connection timeout, nor does it mean a proxy is considered down if latency exceeds 50 ms. If a service requires a stable exit IP—for example, because a login session is sensitive to IP changes—select a specific proxy in select rather than choosing solely by the lowest test latency.
fallback: List order sets priority
fallback also uses url and interval to check whether members are available, but it does not select the proxy with the lowest latency. Suppose the candidates are “Hong Kong 01,” “Hong Kong 02,” and “Japan 01.” As long as “Hong Kong 01” is considered available, the group will use it—even if “Hong Kong 02” has lower test latency. The group only tries the next member when the first one is unavailable.
That makes fallback a good fit when you need a primary proxy and backups: put the preferred proxy first and backups after it. When ordering the list, check that each proxy supports the services you need, not just its name. Switching after a failed test depends on the health check; it does not retry every web request on the spot. Existing connections should not be assumed to migrate automatically to a different proxy.
load-balance: Distribute connections, not bandwidth
load-balance distributes connections across multiple available proxies. In mihomo, strategy: consistent-hashing uses consistent hashing, which tends to route the same destination through the same proxy. strategy: round-robin distributes connections in rotation. This applies to connections; it does not split one file download across multiple routes and combine their throughput. You cannot add up proxies' advertised bandwidth to calculate the speed of a single connection.
Choose a strategy based on how you use the connection. For a site where you want the exit proxy to stay consistent, start with consistent-hashing. To distribute independent requests among proxies in turn, test round-robin. Rotating exit IPs can trigger extra checks for services involving logins, payments, or trusted source addresses. In those cases, use a specific proxy or fallback instead of repeatedly shortening the test interval.
Editable proxy-groups config
This example assumes your existing proxies or proxy providers already include proxies named “Hong Kong 01,” “Hong Kong 02,” and “Japan 01.” Before pasting, replace each name with the exact name used in your config, including spaces. proxy-groups and rules are top-level fields; do not nest them under a proxy. If your file already has either field at the top level, merge the contents rather than adding a duplicate.
proxy-groups:
- name: Auto Select
type: url-test
proxies:
- Hong Kong 01
- Hong Kong 02
- Japan 01
url: https://www.gstatic.com/generate_204
interval: 300
tolerance: 50
- name: Failover
type: fallback
proxies:
- Hong Kong 01
- Hong Kong 02
- Japan 01
url: https://www.gstatic.com/generate_204
interval: 300
- name: Load Balance
type: load-balance
proxies:
- Hong Kong 01
- Hong Kong 02
- Japan 01
url: https://www.gstatic.com/generate_204
interval: 300
strategy: consistent-hashing
- name: Manual Select
type: select
proxies:
- Auto Select
- Failover
- Load Balance
- Hong Kong 01
- DIRECT
rules:
- MATCH,Manual Select
MATCH is a catch-all rule and belongs at the end of the existing rules. If you replace your file's rules with the example, your existing routing rules will no longer apply. To keep them, change only the target group names for the rules that need to use “Manual Select,” and preserve the existing rule order. To make “Load Balance” use round-robin, first confirm that your core supports it, then set its strategy to round-robin.
Using proxy providers
If your proxies come from proxy-providers rather than being listed directly under proxies, a group can reference an existing provider using use. For example, if the provider's top-level key is main-provider, add use: [main-provider] to the relevant group. First confirm that the provider loaded successfully, then check that its proxies appear in the group. Adding use does not create a subscription or fill in its URL. To include manually configured proxies as well, configure use and proxies in the same group using syntax supported by your core.
Post-import checks
- Check syntax and names first. YAML uses spaces for indentation.
type,proxies,url, andintervalshould belong to the same group. If the client reports a missing proxy, compare each member name exactly. If it reports a duplicate field, check whether you pasted a second top-levelproxy-groupsorrulesfield. - Then check health tests. On the client's “Proxies” page, open “Auto Select” or “Failover” and run a latency test. Check whether all three proxies return a result. If they all fail, first check whether the test address is reachable and whether the proxies themselves can connect; don't immediately shorten
interval: 300. - Finally, check the traffic path. On the “Proxies” page, select “Manual Select” and its nested group, and confirm that the client is set to capture traffic. Then visit the target site. In rule mode, check the connection log to see which rule matched. If the client is in global or direct mode,
MATCHinrulesalone does not tell you which proxy traffic actually uses.
Use select when you need to choose a stable exit proxy; url-test when you want to prioritize measured latency; fallback when you need a defined primary-and-backup order; and load-balance when you want to distribute separate connections across proxies. All four group types can coexist in one config. The key is to point rules to the right groups and recheck proxy names, test results, and current selections after subscription updates.