Proxy groups — mihomo
Proxy groups are named bundles of proxies / other groups that act as a single named outbound. mihomo offers four group types: select (manual), url-test (latency-based auto), fallback (sequential health-based), and load-balance (distribute traffic).
Common options
Every group type carries the same GroupCommonOption base. The group:"..." struct tag is mihomo's own — the YAML keys match the tag.
| Field | Type | Default | Allowed values | Description |
|---|---|---|---|---|
name | string | (required) | <string> | Unique group name. Referenced from rules and other groups. |
type | string | (required) | select | url-test | fallback | load-balance | Group type. `relay` was removed — use `dialer-proxy` on the proxy entry instead. |
proxies | []string | [] | [<proxy or group name>] | Explicit list of members. Use `use:` for provider-based membership. |
use | []string | [] | [<proxy-provider name>] | Pull members from named proxy-providers. |
url | string | (required for url-test/fallback) | <URL> | Health-check URL — periodic GET on this URL measures member latency. Typical: `http://www.gstatic.com/generate_204`. |
interval | int | 300 | <seconds> | Seconds between health checks. |
timeout | int | 5000 | <milliseconds> | Health-check timeout in milliseconds. |
max-failed-times | int | 5 | <int> | Consecutive health-check failures before a member is considered down. |
empty-fallback | string | (unset) | <proxy name> | Proxy to fall back to when the group resolves to no usable members (e.g. everything was removed by `filter`). |
lazy | bool | true | true | false | When true, health checks only run when the group is actively in use. Saves bandwidth on standby groups. |
disable-udp | bool | false | true | false | Reject UDP traffic on this group. Useful when members don't all support UDP. |
filter | string | (unset) | <regex> | <regex>`<regex>... | Regex filter applied to member names. Multiple regexes can be backtick-separated. |
exclude-filter | string | (unset) | <regex> | Regex filter — exclude any member whose name matches. |
exclude-type | string | (unset) | <proxy type> | Exclude members of specific types (e.g. `direct,ss`). |
expected-status | string | * | <HTTP status range> | Acceptable health-check status codes. `2xx` or `200-204,301`. |
include-all | bool | false | true | false | Auto-include all proxies and providers — saves listing them manually. |
include-all-proxies | bool | false | true | false | Auto-include all proxy entries (but not providers). |
include-all-providers | bool | false | true | false | Auto-include all proxy-providers (but not direct proxies). |
hidden | bool | false | true | false | Hide the group from the dashboard UI. |
icon | string | (unset) | <URL> | Icon URL displayed by compatible dashboards. |
Source: adapter/outboundgroup/parser.go:25-46 · pinned at v1.19.27 (5184081)
type: select
Manual selection. The group exposes its current pick to the Clash API (dashboards let users switch). No health-checking — the picked member is used as-is.
proxy-groups:
- name: Manual
type: select
proxies: [Proxy-A, Proxy-B, Proxy-C, DIRECT]type: url-test
Auto-pick the fastest member by periodic URL latency probe. The probe runs every interval seconds; the active pick changes only when a new member is faster by more than the legacy tolerance (parsed by parseURLTestOption at adapter/outboundgroup/urltest.go:198-205).
proxy-groups:
- name: Auto
type: url-test
url: http://www.gstatic.com/generate_204
interval: 300
timeout: 5000
tolerance: 50
proxies: [Proxy-JP, Proxy-US, Proxy-HK, Proxy-SG]Extra option:
tolerance(int, milliseconds) — switch threshold. Defaults to 0 (always switch to the absolute fastest, which can thrash).
type: fallback
Use the first member that's responding. Members are health-checked in declaration order; the first one that's alive carries all traffic. Useful for "primary + backup" patterns.
proxy-groups:
- name: HA
type: fallback
url: http://www.gstatic.com/generate_204
interval: 60
timeout: 3000
max-failed-times: 3
proxies: [Primary, Backup, DIRECT]type: load-balance
Distribute traffic across members. The strategy field picks the algorithm:
| Strategy | Behavior |
|---|---|
round-robin | Rotate through members in order. |
consistent-hashing | Hash the destination domain — same domain always goes to the same member. Useful for sticky CDN routing. |
sticky-sessions | First connection from a client picks a member; subsequent connections from the same client reuse it. |
proxy-groups:
- name: Distributed
type: load-balance
url: http://www.gstatic.com/generate_204
interval: 300
strategy: consistent-hashing
proxies: [Proxy-1, Proxy-2, Proxy-3]type: relay — removed
Was a chain-of-proxies group. Removed; the replacement is the per-proxy dialer-proxy: field (see Direct for an example). Configs that still declare type: relay fail with an explicit error at startup (adapter/outboundgroup/parser.go:187-188).
Member-set tools
When you have many proxies, manually listing them on every group is painful. The four include-all* flags + filter / exclude-filter solve this:
proxy-groups:
- name: All-JP
type: url-test
url: http://www.gstatic.com/generate_204
interval: 300
include-all: true
filter: 'JP|Japan|🇯🇵'
exclude-type: 'direct,reject'The four flags ratchet up:
include-all: trueis shorthand for bothinclude-all-proxiesandinclude-all-providers: true.include-all-proxiescovers entries inproxies:.include-all-providerscovers entries pulled in viaproxy-providers:.- Plain
use:references named providers explicitly.
filter accepts backtick-separated regexes — each is an OR. So filter: 'JP\Japan`🇯🇵'` matches any proxy whose name contains any of the three strings.
Examples
A typical multi-tier setup:
proxy-providers:
vendor1:
type: http
url: https://example.com/sub
interval: 86400
path: ./providers/vendor1.yaml
proxy-groups:
- name: 🚀 Proxy
type: select
proxies: [♻️ Auto, 🔯 Fallback, 🔮 LoadBalance, DIRECT]
- name: ♻️ Auto
type: url-test
url: http://www.gstatic.com/generate_204
interval: 300
tolerance: 50
use: [vendor1]
filter: '香港|新加坡|HK|SG'
- name: 🔯 Fallback
type: fallback
url: http://www.gstatic.com/generate_204
interval: 60
use: [vendor1]
filter: '日本|JP'
- name: 🔮 LoadBalance
type: load-balance
url: http://www.gstatic.com/generate_204
interval: 300
strategy: consistent-hashing
use: [vendor1]
- name: 🎬 Stream
type: select
include-all: true
filter: '美|US|🇺🇸'
rules:
- DOMAIN-SUFFIX,netflix.com,🎬 Stream
- MATCH,🚀 ProxyCross-core notes
sing-box equivalent — selector / urltest outbounds
sing-box implements the same idea as outbound types rather than a separate "group" concept:
{
"outbounds": [
{ "type": "selector",
"tag": "manual",
"outbounds": ["proxy-jp", "proxy-us", "direct"],
"default": "proxy-jp",
"interrupt_exist_connections": false },
{ "type": "urltest",
"tag": "auto",
"outbounds": ["proxy-jp", "proxy-us"],
"url": "https://www.gstatic.com/generate_204",
"interval": "3m",
"tolerance": 50 }
]
}Selector:
| Field | Type | Default | Allowed values | Description |
|---|---|---|---|---|
outbounds | []string | (required) | [<outbound tag>] | Member outbounds. |
default | string | (first in outbounds) | <outbound tag> | Initial selection at startup. |
interrupt_exist_connections | bool | false | true | false | When the selection changes, close in-flight connections that used the previous member. |
Source: option/group.go:5-9 · pinned at v1.13.11 (553cfa1)
URLTest:
| Field | Type | Default | Allowed values | Description |
|---|---|---|---|---|
outbounds | []string | (required) | [<outbound tag>] | Member outbounds. |
url | string | https://www.gstatic.com/generate_204 | <URL> | Health-check URL. |
interval | badoption.Duration | 3m | <duration> | How often to re-test members. |
tolerance | uint16 | 50 | <milliseconds> | Switch to a new member only if it's faster by more than this many milliseconds. Prevents thrashing when two members have similar latency. |
idle_timeout | badoption.Duration | 30m | <duration> | Stop health-checking after this much idle time — resume on next demand. |
interrupt_exist_connections | bool | false | true | false | Close in-flight connections on switchover. |
Source: option/group.go:11-18 · pinned at v1.13.11 (553cfa1)
sing-box has no exact equivalent of mihomo's fallback or load-balance groups. The closest pattern is to use urltest with a very tight tolerance for fallback-style behavior, or chain selectors.
Xray equivalent — balancers
Xray's balancers are documented on the Routing page. Strategy values: random, roundRobin, leastPing, leastLoad. There is no Xray equivalent of "selector" (manual pick) — balancers auto-route based on strategy.
