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 = 300Types
type | Chooses |
|---|---|
select | the member picked in the UI; the first member until you pick one |
url-test | the member with the lowest latency on the health check |
fallback | the first member, in list order, that passes the health check |
load-balance | a member per connection, by strategy |
Fields
| Field | Type | Used by | Notes |
|---|---|---|---|
name | string | all | required; unique among proxies and groups; no commas |
type | string | all | required; one of the four types |
proxies | array | all | required; names of [[proxy]] entries, DIRECT or REJECT |
url | string | url-test, fallback, load-balance | health-check URL; should return quickly, for example https://www.gstatic.com/generate_204 |
interval | integer | same | seconds between health checks; must be positive. Without it no health check runs, so url-test and fallback never switch |
tolerance | integer | url-test | milliseconds; only switch when another member is this much faster |
strategy | string | load-balance | consistent-hashing (same destination, same member) or round-robin |
dialer-proxy | string | all | connect every member through this proxy, see Proxy Chains |
icon | string | all | shown 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 = 50Spread connections:
toml
[[proxy-group]]
name = "spread"
type = "load-balance"
proxies = ["office", "home"]
strategy = "consistent-hashing"
url = "https://www.gstatic.com/generate_204"
interval = 300Rules the validator enforces
- Groups cannot contain groups. Members must be proxies,
DIRECTorREJECT. 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
proxieslist is rejected. - With
dialer-proxy, members must be concrete proxies (noDIRECTorREJECT), 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-balancedistributes whole connections; it does not add bandwidth to a single download.- Adding
DIRECTas the last member of afallbackgroup keeps traffic flowing when every proxy is down. Leave it out if that traffic must never go direct.