fix: improve online detection when Clash API omits user metadata
Match connections by multiple auth keys, fall back to global traffic for single-node setups, and document offline-status troubleshooting. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+17
-2
@@ -78,8 +78,23 @@ systemctl restart sing-box jiedian-panel
|
||||
|
||||
### 在线状态始终离线但客户端能连
|
||||
|
||||
- 有流量时面板会按速率推断在线;若仍显示离线,执行 `curl -s -H "Authorization: Bearer $(grep CLASH_API_SECRET /opt/jiedian/.env | cut -d= -f2)" http://127.0.0.1:9090/connections | head` 查看连接 metadata 是否含 user 字段
|
||||
- 修改节点或升级后需重新渲染配置:`python3 /opt/jiedian/scripts/render-server.py && systemctl restart sing-box`
|
||||
面板通过 sing-box **Clash API** 判断在线。统计服务显示「正常」只代表 API 能访问,不代表能识别到连接。
|
||||
|
||||
常见原因:
|
||||
|
||||
1. **Clash API 未带 user 字段**(Hysteria2 旧配置未设置 `name`)→ 重新生成配置:
|
||||
```bash
|
||||
python3 /opt/jiedian/scripts/render-server.py && systemctl restart sing-box
|
||||
```
|
||||
2. **仅有一个节点时**:新版面板会把所有活跃连接归到该节点;多节点需确保 hy2 用户 `name` 与 VLESS 的 UUID 一致。
|
||||
3. **客户端测速有延迟但面板仍离线**:在 VPS 上查看 Clash 连接列表:
|
||||
```bash
|
||||
curl -s -H "Authorization: Bearer $(grep ^CLASH_API_SECRET= /opt/jiedian/.env | cut -d= -f2)" \
|
||||
http://127.0.0.1:9090/connections | python3 -m json.tool | head -80
|
||||
curl -s -H "Authorization: Bearer $(grep ^CLASH_API_SECRET= /opt/jiedian/.env | cut -d= -f2)" \
|
||||
http://127.0.0.1:9090/traffic
|
||||
```
|
||||
若 `connections` 为空但 `traffic` 有速率,说明在传流量但连接详情未上报,单节点场景面板会用全局速率推断在线。
|
||||
|
||||
### 面板打不开 / 404
|
||||
|
||||
|
||||
Reference in New Issue
Block a user