Skip to content

Proxy Groups

A [[proxy-group]] gives one name to several proxies and decides which one a connection uses. Rules and global-proxy can target a group exactly like a proxy.

toml
[[proxy-group]]
name = "work"
type = "fallback"
proxies = ["office", "office-backup", "DIRECT"]
url = "https://www.gstatic.com/generate_204"
interval = 300

Types

typeChooses
selectthe member picked in the UI; the first member until you pick one
url-testthe member with the lowest latency on the health check
fallbackthe first member, in list order, that passes the health check
load-balancea member per connection, by strategy

Fields

FieldTypeUsed byNotes
namestringallrequired; unique among proxies and groups; no commas
typestringallrequired; one of the four types
proxiesarrayallrequired; names of [[proxy]] entries, DIRECT or REJECT
urlstringurl-test, fallback, load-balancehealth-check URL; should return quickly, for example https://www.gstatic.com/generate_204
intervalintegersameseconds between health checks; must be positive. Without it no health check runs, so url-test and fallback never switch
toleranceintegerurl-testmilliseconds; only switch when another member is this much faster
strategystringload-balanceconsistent-hashing (same destination, same member) or round-robin
dialer-proxystringallconnect every member through this proxy, see Proxy Chains
iconstringallshown in the UI

Any other field is rejected with unknown field.

Examples

Pick by hand:

toml
[[proxy-group]]
name = "exit"
type = "select"
proxies = ["office", "home", "DIRECT"]

Fastest of several:

toml
[[proxy-group]]
name = "auto"
type = "url-test"
proxies = ["office", "home"]
url = "https://www.gstatic.com/generate_204"
interval = 300
tolerance = 50

Spread connections:

toml
[[proxy-group]]
name = "spread"
type = "load-balance"
proxies = ["office", "home"]
strategy = "consistent-hashing"
url = "https://www.gstatic.com/generate_204"
interval = 300

Rules the validator enforces

  • Groups cannot contain groups. Members must be proxies, DIRECT or REJECT. To combine two groups' members, list the proxies directly.
  • Every member must exist. A misspelled name fails with Proxy group '<group>' references unknown proxy: <name>.
  • At least one member. An empty proxies list is rejected.
  • With dialer-proxy, members must be concrete proxies (no DIRECT or REJECT), and the dialer proxy must not also be a member.
  • The group field use (members from a provider by filter) is not available in the current build.

Notes

  • A health check only proves that the check URL is reachable through that member. Choose a URL that goes the same way as the traffic you care about.
  • load-balance distributes whole connections; it does not add bandwidth to a single download.
  • Adding DIRECT as the last member of a fallback group keeps traffic flowing when every proxy is down. Leave it out if that traffic must never go direct.