Skip to content

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.

FieldTypeDefaultAllowed valuesDescription
namestring(required)<string>Unique group name. Referenced from rules and other groups.
typestring(required)select | url-test | fallback | load-balanceGroup 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.
urlstring(required for url-test/fallback)<URL>Health-check URL — periodic GET on this URL measures member latency. Typical: `http://www.gstatic.com/generate_204`.
intervalint300<seconds>Seconds between health checks.
timeoutint5000<milliseconds>Health-check timeout in milliseconds.
max-failed-timesint5<int>Consecutive health-check failures before a member is considered down.
empty-fallbackstring(unset)<proxy name>Proxy to fall back to when the group resolves to no usable members (e.g. everything was removed by `filter`).
lazybooltruetrue | falseWhen true, health checks only run when the group is actively in use. Saves bandwidth on standby groups.
disable-udpboolfalsetrue | falseReject UDP traffic on this group. Useful when members don't all support UDP.
filterstring(unset)<regex> | <regex>`<regex>...Regex filter applied to member names. Multiple regexes can be backtick-separated.
exclude-filterstring(unset)<regex>Regex filter — exclude any member whose name matches.
exclude-typestring(unset)<proxy type>Exclude members of specific types (e.g. `direct,ss`).
expected-statusstring*<HTTP status range>Acceptable health-check status codes. `2xx` or `200-204,301`.
include-allboolfalsetrue | falseAuto-include all proxies and providers — saves listing them manually.
include-all-proxiesboolfalsetrue | falseAuto-include all proxy entries (but not providers).
include-all-providersboolfalsetrue | falseAuto-include all proxy-providers (but not direct proxies).
hiddenboolfalsetrue | falseHide the group from the dashboard UI.
iconstring(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.

yaml
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).

yaml
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.

yaml
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:

StrategyBehavior
round-robinRotate through members in order.
consistent-hashingHash the destination domain — same domain always goes to the same member. Useful for sticky CDN routing.
sticky-sessionsFirst connection from a client picks a member; subsequent connections from the same client reuse it.
yaml
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:

yaml
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: true is shorthand for both include-all-proxies and include-all-providers: true.
  • include-all-proxies covers entries in proxies:.
  • include-all-providers covers entries pulled in via proxy-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:

yaml
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,🚀 Proxy

Cross-core notes

sing-box equivalent — selector / urltest outbounds

sing-box implements the same idea as outbound types rather than a separate "group" concept:

json
{
  "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:

FieldTypeDefaultAllowed valuesDescription
outbounds[]string(required)[<outbound tag>]Member outbounds.
defaultstring(first in outbounds)<outbound tag>Initial selection at startup.
interrupt_exist_connectionsboolfalsetrue | falseWhen 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:

FieldTypeDefaultAllowed valuesDescription
outbounds[]string(required)[<outbound tag>]Member outbounds.
urlstringhttps://www.gstatic.com/generate_204<URL>Health-check URL.
intervalbadoption.Duration3m<duration>How often to re-test members.
toleranceuint1650<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_timeoutbadoption.Duration30m<duration>Stop health-checking after this much idle time — resume on next demand.
interrupt_exist_connectionsboolfalsetrue | falseClose 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.

Core Tutorial by Argsment