dsh-lan-bridge
DeepSeek Harness plugin + LAN bridge: injects a crypto.randomUUID polyfill so the harness web UI works over plain HTTP from phones (no certs, no public tunnels, works on old iOS). Install as a dsh plugin, or run the standalone proxy via the CLI.
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Def1ce/dsh-lan-bridge说明文档
阅读完整 README ↗dsh-lan-bridge
Fixes the DeepSeek Harness web UI on phones: injects a crypto.randomUUID polyfill so the harness works over plain HTTP — no certs, no warnings, no public tunnels, works on old iOS too. Zero dependencies.
Two ways to use it:
- dsh plugin (recommended): install into the harness, the polyfill is served by dsh itself — the phone opens dsh's own port directly, no extra process.
- Standalone proxy (
bin/dsh-bridge.cjs): proxy any local web app on the LAN with the polyfill.
| 简体中文 | English |
|---|---|
| 中文说明 | English |
中文说明
为什么会有这个项目
用手机访问 dsh 网页界面时会碰到一个隐蔽的坑:
crypto.randomUUID is not a function. (In 'crypto.randomUUID()', 'crypto.randomUUID' is undefined)
原因:
- dsh 前端代码大量调用
crypto.randomUUID()(生成 RPC 消息 ID)。 - 这个函数只在 HTTPS(或 localhost)安全上下文中存在,普通
http://下是undefined。 - 更糟的是 iOS 15.4 以下的 Safari/浏览器根本没有这个函数,连 HTTPS 都没用。
- 想补 HTTPS?自签名证书在 iOS Safari 里会直接拒绝打开,连"继续访问"按钮都没有;正式证书又要域名/公网。
于是手机访问陷入死循环:http 打不开功能,https 打不开网页。
解决办法
crypto.getRandomValues() 是所有浏览器、所有环境(包括 http、老 iOS)都有的 API。本项目在 dsh 返回的页面里注入一段极小的 polyfill,用 getRandomValues 实现 randomUUID:
if (typeof crypto === 'object' && crypto && !crypto.randomUUID && crypto.getRandomValues) {
crypto.randomUUID = function () { /* 用 getRandomValues 生成 UUID v4 */ };
}
于是纯 HTTP 就能完整使用 dsh:零证书、零警告、任何浏览器、任何 iOS 版本。
方式一:作为 dsh 插件安装(推荐)
包内 dsh/index.js 是一个 dsh bundle 插件:它通过 webServer.tapIndex 把 polyfill 注入 dsh 自己返回的 index.html。装进 harness 后,手机直接访问 dsh 端口即可。