fix: use Clash API only for traffic stats on stock sing-box builds

Official sing-box binaries lack v2ray_api, so drop that config and grpcio
and track per-node traffic from Clash connection stats instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-16 10:02:41 +08:00
parent ccf7e2a4c7
commit 6edba863b5
5 changed files with 106 additions and 181 deletions
-9
View File
@@ -58,7 +58,6 @@ def build_config(env: dict[str, str], nodes: list[dict]) -> dict:
hy2_users = [
{"name": n["uuid"], "password": n["hy2_password"]} for n in nodes
]
user_ids = [n["uuid"] for n in nodes]
clash_secret = env.get("CLASH_API_SECRET", "")
config = {
@@ -109,14 +108,6 @@ def build_config(env: dict[str, str], nodes: list[dict]) -> dict:
"clash_api": {
"external_controller": "127.0.0.1:9090",
},
"v2ray_api": {
"listen": "127.0.0.1:9091",
"stats": {
"enabled": True,
"inbounds": ["vless-reality-in", "hysteria2-in"],
"users": user_ids,
},
},
}
if clash_secret:
experimental["clash_api"]["secret"] = clash_secret