Files
agent/tunnel/client.example.yml
kicer dab9d8f000 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
能按用户配置的镜像自动替换。
2026-11-15 12:22:59 +08:00

33 lines
1.3 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# tunnel 本机端配置 —— 复制为 client.yml 后改(client.yml 不进版本库)
# 服务器隧道地址,两种形态按需选:
# 只有 IP(最省事,但要求服务器把 19000 映射到 0.0.0.0)
# ws://1.2.3.4:19000/tunnel ← 明文,token 在公网裸奔,仅限内网/临时调试
# 有域名 + 证书(推荐,前面套 nginx 反代)
# wss://tunnel.example.com/tunnel
server: "ws://1.2.3.4:19000/tunnel"
# 和服务器 server.yml 里自动生成的 token 一致
token: ""
# 握手 UA:伪装成浏览器,降低被 DPI 盯上的概率。不写就用内置默认值
# userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
# 请求体上限(MB),和服务端双保险
maxBodyMb: 64
# 要暴露的本地服务:加服务 = 加一项,两边代码都不用动
# 路由优先级:固定端口指定的 name → host 精确 → *.域名 通配 → "*" 兜底
services:
# 直接按 IP 访问时,请求的 Host 头就是那个 IP,用 "*" 兜底最省事(单服务形态)
- host: "*"
port: 8090
# 有域名时按 Host 精确匹配,一个域名对一个服务
# - name: agent
# host: agent.example.com
# port: 8090
# - name: nas
# host: nas.example.com
# port: 5000