Net: 8 s health-check timeout, show a dead proxy only after two misses

AmneziaWG 3 tunnels idle for a while need 5+ s for the first handshake, so the
4-5 s checks marked working connections as dead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maksarsanjeev
2026-10-19 11:31:03 +03:00
parent 3c7931d710
commit 46901f2b62
3 changed files with 29 additions and 17 deletions
+6 -6
View File
@@ -229,7 +229,7 @@ def main():
# Fetch through the exit: the subscription host is unreachable directly from home
# (the pull failed with EOF and the node list went stale).
"type": "http", "url": sub, "interval": 3600, "path": "./providers/vless.yaml", "proxy": "exit",
"health-check": {"enable": True, "url": TEST_URL, "interval": 300}}
"health-check": {"enable": True, "url": TEST_URL, "interval": 300, "timeout": 8000}}
if hid["vless"]:
# Hidden nodes stay in the subscription, the core just skips them.
vless["exclude-filter"] = "^(?:" + "|".join(rx(n) for n in hid["vless"]) + ")$"
@@ -241,11 +241,11 @@ def main():
vless_file = os.path.join(KEYS, "vless.txt")
if os.path.exists(vless_file) and any(l.strip().startswith("vless://") for l in open(vless_file)):
extra_prov["vless-keys"] = {"type": "file", "path": "./keys/vless.txt",
"health-check": {"enable": True, "url": TEST_URL, "interval": 300}}
"health-check": {"enable": True, "url": TEST_URL, "interval": 300, "timeout": 8000}}
if hid["vless"]:
extra_prov["vless-keys"]["exclude-filter"] = vless["exclude-filter"]
awg_prov = {"type": "file", "path": "./keys/amnezia.yaml",
"health-check": {"enable": True, "url": TEST_URL, "interval": 300}}
"health-check": {"enable": True, "url": TEST_URL, "interval": 300, "timeout": 8000}}
cfg = {
"mixed-port": 7890, "allow-lan": False, "mode": "rule", "log-level": "error", "ipv6": False,
@@ -268,18 +268,18 @@ def main():
# Back to the pick as soon as it answers again. Checked every 30 s and right after
# 3 failed connections.
{"name": "exit", "type": "fallback", "proxies": ["ai-out", "auto"],
"url": TEST_URL, "interval": 30, "timeout": 4000, "max-failed-times": 3, "lazy": False},
"url": TEST_URL, "interval": 30, "timeout": 8000, "max-failed-times": 3, "lazy": False},
# What BroV's globe panel switches: "auto", the Amnezia group, or one VLESS node.
{"name": "ai-out", "type": "select", "proxies": ["auto", "amnezia"], "use": ["vless-cluster", *extra_prov]},
# Fastest alive exit among every Amnezia connection and every VLESS node;
# switches only when another one is 100+ ms faster.
{"name": "auto", "type": "url-test", "use": ["amnezia-keys", "vless-cluster", *extra_prov],
"url": TEST_URL, "interval": 60, "timeout": 4000, "max-failed-times": 3,
"url": TEST_URL, "interval": 60, "timeout": 8000, "max-failed-times": 3,
"tolerance": 100, "lazy": False},
# Amnezia: "amnezia-auto" (fastest connection) or one fixed connection.
{"name": "amnezia", "type": "select", "proxies": ["amnezia-auto"], "use": ["amnezia-keys"]},
{"name": "amnezia-auto", "type": "url-test", "use": ["amnezia-keys"],
"url": TEST_URL, "interval": 60, "timeout": 4000, "max-failed-times": 3,
"url": TEST_URL, "interval": 60, "timeout": 8000, "max-failed-times": 3,
"tolerance": 100, "lazy": False},
] + [
# Client networks: off (REJECT) until switched on in BroV.