Proxy Groups (proxy-groups)¶
Proxy groups combine individual outbound proxies and proxy-providers under selection, health-checking, failover, load-balancing, chaining, or adaptive-scoring strategies.
Common Rules¶
- Group names must be globally unique and cannot be
DIRECTorREJECT. - Every group must reference at least one proxy via
proxiesand/oruse. - Nested group references are allowed; ClashRS topologically sorts groups via DAG validation and rejects cycles.
- A built-in
GLOBALgroup (type: select,udp: true) is created automatically containing all static proxies, groups, andproxy-providers. intervalonurl-test,fallback, andload-balanceaccepts either an integer or numeric string (seconds);0disables automatic periodic checks.
Unsupported Mihomo Proxy Group Keys
filter, exclude-filter, exclude-type, hidden, include-all, include-all-proxies, include-all-providers, disable-udp, expected-status, timeout, max-failed-times, interface-name, and routing-mark are not defined on proxy groups in ClashRS (silently ignored unless --strict-config is used).
Supported Group Types (6 Types)¶
1. select¶
Manual selection via Web Dashboard or PUT /proxies/{name}. Defaults to the first entry and restores the last selection when profile.store-selected: true (default).
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
name |
string |
Yes | — | Group name. |
type |
"select" |
Yes | — | Group type. |
proxies |
list[string] |
At least one of proxies / use |
None |
Static proxy or group names. |
use |
list[string] |
At least one of proxies / use |
None |
proxy-providers names. |
udp |
bool |
No | true |
Delegates support_udp() to selected proxy when true; forces false otherwise. |
url |
string |
No | http://www.gstatic.com/generate_204 |
URL used only for manual latency tests. |
icon |
string |
No | None |
Icon URL/string exposed to dashboards via REST API. |
2. url-test¶
Automatically selects the lowest-latency alive proxy based on periodic HTTP health checks.
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
name |
string |
Yes | — | Group name. |
type |
"url-test" |
Yes | — | Group type. |
proxies / use |
list[string] |
At least one | None |
Member proxies / providers. |
url |
string |
Yes | — | Health-check URL (e.g. http://www.gstatic.com/generate_204). |
interval |
u64 (seconds) |
Yes | — | Periodic check interval (0 disables automatic checks). |
tolerance |
u16 (ms) |
No | 0 |
Latency difference threshold before switching proxies. |
lazy |
bool |
No | false |
Defer checks until the group is actively used. |
icon |
string |
No | None |
Dashboard icon. |
Advanced runtime behaviors:
- Manual pin/override: Supports
PUT /proxies/{name}with{"name": "<node>"}to pin a specific member; send""(or"auto"/"default"if no node has that name) to return to automatic selection. - Passive circuit breaker: 3 consecutive connection failures within 60 seconds trip a 30-second cooldown, steering traffic around failing nodes.
- High-throughput switch guard: Skips routine latency-based switches while global throughput exceeds 250 KB/s (unless the current node fails or trips).
- Adaptive tolerance: After 12 consecutive checks without switching where average latency differs by > 20 ms, temporarily lowers effective tolerance to 20 ms until a switch occurs.
3. fallback¶
Selects the first alive proxy in list order; falls back to the first proxy if all checks fail.
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
name, type, proxies, use, icon |
Same as above | — | — | type: fallback. |
url |
string |
Yes | — | Health-check URL. |
interval |
u64 (seconds) |
Yes | — | Check interval. |
lazy |
bool |
No | false |
Defer checks until traffic arrives. |
4. load-balance¶
Distributes connections across alive proxies.
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
name, type, proxies, use, icon |
Same as above | — | — | type: load-balance. |
url |
string |
Yes | — | Health-check URL. |
interval |
u64 (seconds) |
Yes | — | Check interval. |
lazy |
bool |
No | false |
Defer checks until traffic arrives. |
strategy |
"consistent-hashing" | "round-robin" | "sticky-session" |
No | "consistent-hashing" |
Distribution strategy. |
Current Runtime Caveats
- Although all three
strategyvalues are parsed, the current outbound manager instantiation always applies the defaultconsistent-hashingstrategy (Murmur3 + jump hash by eTLD+1 domain or destination IP). load-balancecurrently reportssupport_udp() == false.
5. relay¶
Chains proxies in order (proxies[0] -> proxies[1] -> ... -> destination) for multi-hop TCP and UDP forwarding.
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
name |
string |
Yes | — | Group name. |
type |
"relay" |
Yes | — | Group type. |
proxies / use |
list[string] |
At least one | None |
Ordered hop list. |
url |
string |
No | http://www.gstatic.com/generate_204 |
Manual latency test URL. |
icon |
string |
No | None |
Dashboard icon. |
6. smart¶
Adaptive scoring group that ranks proxies using historical latency, success rate, trend, stability, packet loss, RTT, and failure penalties. Supports exponential-backoff retries on TCP (100 ms up to 5 s); UDP selects the top-ranked node directly. Statistics persist every 30 seconds when profile.store-smart-stats: true.
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
name |
string |
Yes | — | Group name. |
type |
"smart" |
Yes | — | Group type. |
proxies / use |
list[string] |
At least one | None |
Member proxies / providers. |
udp |
bool |
No | true |
Enable UDP support. |
lazy |
bool |
No | false |
Lazy evaluation flag. |
url |
string |
No | None |
Optional test URL. |
max-retries |
u32 |
No | Adaptive (2..=6, initial 3) |
Max TCP retry attempts; when omitted or 0, computed adaptively from average success rate. |
bandwidth-weight |
f64 |
No | 0.0 (disabled) |
When > 0.0, adds delay * 0.1 * bandwidth-weight to node scoring. |
site-stickiness |
f64 |
No | None |
Parsed for compatibility (not yet wired into runtime options). |
icon |
string |
No | None |
Dashboard icon. |
Example¶
proxy-groups:
- name: PROXY
type: select
proxies:
- AUTO
- SMART
- FALLBACK
- DIRECT
- name: AUTO
type: url-test
use:
- sub-provider
url: http://www.gstatic.com/generate_204
interval: 300
tolerance: 50
- name: SMART
type: smart
use:
- sub-provider
udp: true
max-retries: 3
bandwidth-weight: 0.2
- name: FALLBACK
type: fallback
proxies:
- node-a
- node-b
- DIRECT
url: http://www.gstatic.com/generate_204
interval: 300
- name: CHAIN
type: relay
proxies:
- entry-node
- exit-node