URLTest
An outbound group that uses the member whose probe answered fastest.
Structure
json
{
"tag": "auto",
"protocol": {
"type": "urltest",
"settings": {
"members": ["server-a", "server-b"],
"probe": {
"url": "https://www.gstatic.com/generate_204",
"interval": "5m",
"timeout": "10s",
"expected_status": "200-299"
},
"tolerance": "50ms"
}
}
}A group has only tag and protocol: no server, transport or dns_server.
Fields
members
list of tagsRequired
The outbounds to choose from, by tag. A member may be another group. The order breaks ties.
probe
object
How members are measured. See Probe.
tolerance
durationDefault: 50ms
How much faster another member must be before the group switches to it. Without it, two servers of similar speed would swap after every round.
How it chooses
- After each round of probes, it switches to the fastest member that passed only if that member beats the current one by more than
tolerance. If the current member failed, it switches at once. - A connection tries the members in that order and uses the first that connects. A member whose probe failed is tried last.
- Until the first round ends, and when every probe fails, it keeps list order or its last good member.
- A UDP session keeps the member it got first.
- The group carries only the networks every member carries: one TCP-only member makes the group TCP-only.
An example with tolerance at 50ms:
| Round | server-a (current) | server-b | Result |
|---|---|---|---|
| 1 | 120 ms | 100 ms | 20 ms faster: stays on server-a |
| 2 | 140 ms | 70 ms | 70 ms faster: switches to server-b |
| 3 | 90 ms | 100 ms | server-a 10 ms faster: stays on server-b |
Existing connections never move; only new ones use the new member.