feat(tunnel): 通用反向隧道 server/client,按 Host/固定端口/通配路由,SSE 逐帧透传

服务端按 Host 头或固定端口把请求转给家里的 client,WS 长连接承载,
token 首次启动自动生成;响应流式逐帧回传,SSE 不受影响。
配置用 YAML(server.yml 自动生成,client.yml 手写),与项目其余配置一致。
This commit is contained in:
2026-11-15 11:33:29 +08:00
parent da8653e5e9
commit d455c2d203
9 changed files with 773 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
{
"name": "agent-tunnel",
"version": "0.1.0",
"private": true,
"description": "通用反向隧道:把本机 HTTP 服务经服务器中转,按 Host 路由,支持流式响应",
"main": "server.js",
"scripts": {
"server": "node server.js",
"client": "node client.js"
},
"dependencies": {
"ws": "^8.18.0",
"yaml": "2.6.1"
}
}