fix(tunnel): client 日志改成只在状态变化时输出,依赖锁死并改回官方源

client.js 原来每次重连都打「连接/连接错误/断开」,服务器不可达时会一直刷屏。
改成状态机:启动一条、连上一条、断开一条,重试全程静默,和 MCP 服务的风格一致。

client.example.yml 改成 IP 为主的示例(多数用户只有 IP,没有域名和证书)。
ws 从 ^8.18.0 锁到 8.23.0,与项目其余 package.json 的精确版本风格统一;
package-lock 的 resolved 改回 registry.npmjs.org,让 npm 的 --replace-registry-host
能按用户配置的镜像自动替换。
This commit is contained in:
2026-11-15 12:22:59 +08:00
parent d455c2d203
commit dab9d8f000
5 changed files with 38 additions and 25 deletions
+1 -1
View File
@@ -20,7 +20,7 @@
## 快速验证(本机,不碰 nginx)
```bash
cd tunnel && npm install
cd tunnel && npm install # 国内慢就加 --registry=https://registry.npmmirror.com
cp client.example.yml client.yml # server 改成 ws://127.0.0.1:19000/tunnel,token 先留空
node server.js & # 首次启动生成 server.yml,日志打印 TOKEN
# 把 TOKEN 填进 client.yml 的 token,再: