DSH Mobile 的电脑侧连接器:连上可自建的公网 WSS 中转,手机在 4G/5G 下即可访问这台电脑上的 DSH 会话,电脑不需要公网 IP 也不用组网;中转只做鉴权与转发。
安装
# npm 包(预构建)
dsh plugin --profile web add dsh-plugin-mobile-link
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:jayantTang/DSH_Mobile#path:/plugins/mobile-link
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
面向:使用者与实现者 · 状态:stable · 最近核对:2026-09-20
The computer half of DSHM: it dials a relay over WSS, so the native iOS client reaches this DSH instance even though the computer has no public IP.
iPhone App ──WSS──▶ Relay(公网,只鉴权与转发)──WSS──▶ this plugin ──HTTP+WS──▶ 127.0.0.1:<port>
The connector always talks to the local DSH as 127.0.0.1:<port>, so the host's
authority and its trust fence are unaffected: no --trusted-host, no rewritten
Host, no new listening port on this machine.
plugins/mobile-link/
├── package.json # type: module, dsh.bundle.patch, bin: dsh-mobile-link
├── cordis.patch.yml # bundle patch: the loader row + config reference
├── lib/
│ ├── index.js # cordis plugin: starts the agent, registers 5 routes
│ ├── link.js # the DLP agent transport: identity, socket, heartbeat, reconnect
│ ├── router.js # frames ⇄ local DSH mux streams, per-device `$events`
│ ├── dlp.js # DLP v1 frame codec (shared with the relay)
│ ├── files.js # phone → computer file transfers (`_link/file*` methods)
│ ├── enroll.js # open enrollment (no invite code), writes ~/.dsh/mobile-link/agent.json
│ ├── journal.js # lifecycle journal: why a relay link was dropped, after the fact
│ ├── routes.js # status, enroll, pair-code, pair-code/regenerate, devices/revoke
│ ├── qr.js # dependency-free QR SVG
│ └── cli.js # dsh-mobile-link: enroll / mint-pair-code
└── test/ # node --test, 100+ tests (no DSH, no network)
Install
The connector runs in whichever host runs your DSH. There are two supported hosts today — the official desktop app and the command-line web host — and each keeps its own profile, so you install the plugin into the one you actually use. The connector discovers the local DSH by itself in both (the host hands it the authenticated loopback address); you never type an address or a token.
Command-line web host
dsh plugin --profile web add dsh-plugin-mobile-link
Official desktop app — install through the app's own plugin page, or with the CLI that
the app ships (…/Resources/runtime/cli/bin/dsh, installable from its settings). The npm
dsh refuses this profile on purpose (profile "desktop" is managed exclusively by the Electron application). Two prerequisites matter in practice: let the app start once so it
initializes its profile, and quit it completely before installing — otherwise the
profile is locked.
# quoting the app's bundled CLI; see docs/ONBOARDING.md for the section titles
"<DeepSeek Harness.app>/Contents/Resources/runtime/cli/bin/dsh" \
plugin --profile desktop add dsh-plugin-mobile-link
Then restart the host (or reload the profile). From a checkout the same command takes
a path — the leading ./ matters, because DSH anchors a relative spec against
your current directory instead of resolving it inside the profile:
dsh plugin --profile web add ./plugins/mobile-link
Use
Register this computer with a relay (once). Open the 移动端连接 panel at the bottom of the DSH sidebar: the relay address is prefilled (editable) from the installation default; click 登记. The connector derives the computer name automatically, writes
~/.dsh/mobile-link/agent.jsonand reconnects in place — no terminal and no DSH restart. Open enrollment is the default; the relay rate-limits by source. If an installation has no panel (headless, CI), the CLI still works:dsh-mobile-link enroll --relay wss://<你的站点>/dsh-link…or register it on the relay host with
dsh-relay admin agent-register --write-config ~/.dsh/mobile-link/agent.json.The same panel shows the pairing code and its QR once the relay link is up. The CLI can still mint one directly:
dsh-mobile-link --mint-pair-code # prints JSON: code + relay + agentIdThe code is persistent: it stays valid until you click 重新生成. Each paired device has a quiet 撤销 action; revoking one device leaves the code and other devices alone.
Scan it in the iOS app. The code can be claimed again for another phone, a reinstall or a new device; only 重新生成 revokes it (already-paired devices stay connected). After that the phone reconnects on its own — nothing else has to be run by hand.
GET /mobile-link/status reports whether the link is up, which devices are
attached, and whether this computer is registered yet. Its enroll block also
carries panel (this connector can enroll from the DSH panel), relayPrefill
and relayLocked (the address to prefill and whether it came from config).
POST /mobile-link/enroll performs that enrollment (open enrollment; no invite code); it returns the agent id and
name, never agentSecret, and is behind the same DSH request fence as pairing. GET /mobile-link/devices lists the full paired roster (including offline) for the panel, and
POST /mobile-link/devices/revoke revokes one paired device by deviceId through the relay; both are behind
the fence and authenticated with the agent secret. Its journal block carries
the current process's newest lifecycle events (link opened/closed with the reason,
device attached/detached); the counters in it reset when the plugin hot-reloads, so
the full history — across restarts — is the JSONL file at journal.path.
Configuration
All optional; the defaults are what a stock deployment needs. Set them in the
plugin's config block (cordis.patch.yml), not by editing this file.
| Key | Default | Meaning |
|---|---|---|
enabled |
true |
false stops the outbound link without uninstalling |
relayUrl |
from agent.json |
Relay base URL; a bare deployment dials <relay>/link/agent. Pinning a real value here outranks the enrolled identity and makes the panel field read-only |
defaultRelayUrl |
empty | Form-only default: prefills the panel's relay input, but never outranks the enrolled identity. Official installs set this so users can still edit it |
agentId / agentSecret |
from agent.json |
Override the enrolled identity |
stateFile |
~/.dsh/mobile-link/agent.json |
Where the identity lives |
journalFile |
~/.dsh/mobile-link/link-events.jsonl |
Lifecycle journal (rotated once at 256 KiB); false keeps it in memory only |
slowRequestMs |
2000 |
A slower single request gets its own request.slow entry; 0 disables those (per-attach device.summary is still written) |
diagnostics |
true |
false refuses the phone's phase uploads; the phone ignores the refusal and stays connected |
dshUrl |
discovery | Explicit local DSH base URL (usually unnecessary — the host hands the connector its own address) |
heartbeatMs |
20000 |
DLP ping interval |
The connector does not read an endpoint handoff file any more: discovery happens inside
the host process (ctx.inject(['webServer','connection'])), which is what makes one npm
package work on both the desktop app and the command-line host. It writes one instead —
$DSH_HOME/mobile-link/endpoint.json, mode 0600 — for tools that run outside the host
(our dev/test scripts and the iOS integration helpers).
Address resolution order: this config block, then DSH_RELAY_URL (or
DSH_MOBILE_LINK_RELAY), then the enrolled identity file, then the repository
placeholder wss://relay.example.com/dsh-link — the placeholder being the
"nothing configured yet" sentinel rather than a real address.
Design notes
- No required services.
injectis empty and the routes are attached throughctx.inject([...]), so a future DSH that renames or dropswebServer/connectioncannot make the tunnel fatal on boot. - Protocol-transparent. Nothing outside
lib/is imported and no DSH business API is touched: the connector forwards frames, it does not interpret sessions. The relay has the same property. - Disable by removing the row from the profile's
cordis.patch.yml, or by settingenabled: false.
Test
cd plugins/mobile-link && npm test # zero dependencies
The wire protocol is specified in
docs/RELAY-PROTOCOL.md.
MIT.
链接
同类插件
zhu1090093659/dsh-web#packages/dsh-remote-web-ui★ 10696
手机/PC 远程操控 dsh web 工作区:扫码配对、令牌门控通道、SSE 实时同步,提供移动端与完整桌面 GUI 两种远程形态。
zhu1090093659/dsh-web#packages/dsh-ssh★ 10696
SSH 远程运维面板:Web 终端、SFTP 传输、本地端口转发与一条命令并发集群执行,Agent 与面板共用同一份主机配置。
liguobao/ds-harness-remote★ 4060
通过端到端加密通道远程访问 DeepSeek Harness 及兼容的编码工作区,支持自适应 Relay/WebRTC 传输、设备授权、工作区文件、只读预览、终端和可选的 Codex Remote。
saya-ch/dsh-mobile★ 1029
通过 Android App 或手机浏览器访问 DeepSeek Harness,支持安全局域网连接、远程访问、持久设备配对和可自定义移动界面。
uumit-ai/dsh-uumit-remote★ 534
用 UUMit 账号在手机或其他电脑上打开这台电脑的 dsh web,不用自建服务器、不装其他程序:插件内置通道客户端连接 UUMit 托管的通道,侧栏里的面板负责配对和选择谁能用(仅自己、通过邀请链接或手机号授权的人、所有人),可随时撤销。需 dsh web 且 DSH >=0.2.1-rc.2。
WNLUO/dsh-mobile-plugin★ 503
DeepSeek Harness App 让你在手机上使用这台电脑或服务器上的 DeepSeek Harness。手机和平板都能用,安卓和苹果都支持。在手机上可以继续对话、查看文件、管理插件,也可以从正在用的这一台连上其他几台上的 DeepSeek Harness,分别打开来用。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。