ced05e06a3
用独立反向代理把 dsh Web UI 发布到局域网。官方 CLI 主动拒绝 `dsh web --host 0.0.0.0`(会把宿主机远程代码执行暴露到网络), 因此本插件让官方服务器保持只绑回环,另开监听并转发。 宿主端(index.js) - 在 0.0.0.0:3082 监听,把 HTTP 与 WebSocket 转发到 127.0.0.1:<webServer 端口> - 上游 Host/Origin 重写为回环,使官方 /api 信任围栏「通过」而不是被绕过 - 不改动 Set-Cookie:浏览器按请求 URL 建立 host-only cookie,转发层无需干预 - 监听端 DNS 重绑定防护;targetHost 仅接受回环地址(不会变成开放代理) - /api/dsh-lan-access/summary 复用官方 connection.admit() 做围栏与浏览器认证 - 启动横幅打印带 launch token 的局域网链接 - 端口被占用时只告警不抛出,并在面板上报 listening:false,不展示不可用的二维码 - ownsHostCompat(默认关):仅为非回环页面声明 ownsHost,恢复官方设置界面 客户端(src/ 经 scripts/build-client.mjs 生成 client.js) - Settings → 局域网访问:局域网地址列表、复制/打开、选中地址的二维码 - 零依赖二维码编码器(byte 模式 / ECC M / version 1–10) 组合层 - 只 insert 一行,不覆盖任何 shipped row:停用本插件只会移除局域网监听, 回环 Web UI 不受影响 验证 - 宿主转发契约 28/28;客户端契约 25/25 - 二维码编码器与 npm qrcode 参考实现在全版本 × 全 8 掩码下逐模块比对 240/240 一致 - 端到端:局域网 token 首访 303 并铸 cookie → 应用 200;无凭证 401; WebSocket 升级 101,且与直连回环逐项行为一致
72 lines
1.8 KiB
JSON
72 lines
1.8 KiB
JSON
{
|
|
"name": "@sutong/dsh-lan-access",
|
|
"version": "0.1.0",
|
|
"description": "Expose the dsh Web UI on the LAN through a standalone reverse proxy that preserves the official launch token — HTTP and WebSocket forwarding, no Host rewrite of your trust boundary.",
|
|
"type": "module",
|
|
"main": "index.js",
|
|
"exports": {
|
|
".": "./index.js",
|
|
"./client": "./client.js",
|
|
"./package.json": "./package.json",
|
|
"./locale/*.json": "./locale/*.json"
|
|
},
|
|
"icon": "./icon.svg",
|
|
"dsh": {
|
|
"bundle": {
|
|
"patch": "./cordis.patch.yml"
|
|
},
|
|
"catalog": {
|
|
"category": "integration",
|
|
"summary": {
|
|
"en": "Access the dsh web UI over the LAN: a standalone reverse proxy forwards HTTP and WebSocket to the loopback server while keeping the official launch-token login.",
|
|
"zh": "局域网访问 dsh web UI:独立反向代理转发 HTTP 与 WebSocket 到回环服务,保留官方 launch token 登录"
|
|
},
|
|
"capabilities": [
|
|
"connection",
|
|
"ui-slots"
|
|
]
|
|
},
|
|
"client": {
|
|
"platform": "web"
|
|
}
|
|
},
|
|
"peerDependencies": {
|
|
"@deepseek-ai/schemastery": "~3.18.4"
|
|
},
|
|
"peerDependenciesMeta": {
|
|
"@deepseek-ai/schemastery": {
|
|
"optional": true
|
|
}
|
|
},
|
|
"files": [
|
|
"index.js",
|
|
"client.js",
|
|
"cordis.patch.yml",
|
|
"src",
|
|
"scripts",
|
|
"locale/*.json",
|
|
"icon.svg",
|
|
"README.md",
|
|
"README.en.md",
|
|
"LICENSE"
|
|
],
|
|
"engines": {
|
|
"node": ">=20.0.0"
|
|
},
|
|
"scripts": {
|
|
"build:client": "node scripts/build-client.mjs",
|
|
"test": "node scripts/smoke.mjs && node scripts/test-qr.mjs && node scripts/test-client.mjs"
|
|
},
|
|
"keywords": [
|
|
"dsh",
|
|
"deepseek-harness",
|
|
"dsh-plugin",
|
|
"plugin",
|
|
"lan",
|
|
"proxy",
|
|
"reverse-proxy",
|
|
"qr"
|
|
],
|
|
"license": "MIT"
|
|
}
|