dsh-pocket 1.0.13 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +10 -12
- package/README.md +10 -12
- package/lib/index.js +3 -3
- package/lib/web-rpc.js +1 -1
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
<h1 align="center">DSH Pocket</h1>
|
|
6
6
|
|
|
7
|
+
<p align="center"><a href="README.en.md">English</a> | <a href="README.md">中文</a></p>
|
|
8
|
+
|
|
7
9
|
<p align="center">
|
|
8
10
|
<a href="https://www.npmjs.com/package/dsh-pocket"><img alt="npm" src="https://img.shields.io/npm/v/dsh-pocket?color=4d6bfe&label=npm"></a>
|
|
9
11
|
<a href="https://www.npmjs.com/package/dsh-pocket"><img alt="downloads" src="https://img.shields.io/npm/dm/dsh-pocket?color=4d6bfe"></a>
|
|
@@ -13,8 +15,6 @@
|
|
|
13
15
|
</p>
|
|
14
16
|
|
|
15
17
|
> Put **DeepSeek Harness in your pocket**: one package, one settings tab — scan a QR code and your phone shows exactly what's on your computer screen, live, from anywhere.
|
|
16
|
-
>
|
|
17
|
-
> [English](README.en.md) | [中文](README.md)
|
|
18
18
|
|
|
19
19
|
## What is this
|
|
20
20
|
|
|
@@ -26,8 +26,6 @@
|
|
|
26
26
|
|
|
27
27
|
That's what DSH Pocket does: **install it, scan a QR code, and your phone shows and controls the DeepSeek Harness UI in real time — from anywhere.**
|
|
28
28
|
|
|
29
|
-
> One-liner: `dsh web` only allows local access by default; DSH Pocket puts a proxy in front of it that safely bridges your phone (see [How it works](#-how-it-works)).
|
|
30
|
-
|
|
31
29
|
What it looks like — the phone shows the exact same UI as your computer, live:
|
|
32
30
|
|
|
33
31
|
<p align="center">
|
|
@@ -79,10 +77,6 @@ On the same page click "**Enable anywhere**" → wait for the tunnel (first run
|
|
|
79
77
|
|
|
80
78
|
> Upgrading: `dsh plugin --profile web update dsh-pocket --latest -w` (`--latest` is required across major versions — a `^0.x` range won't auto-jump to 1.x).
|
|
81
79
|
|
|
82
|
-
## 🧭 How it works
|
|
83
|
-
|
|
84
|
-
DSH's `/api` browser-trust fence only accepts loopback or `--trusted-host` authorities (and the official build refuses `0.0.0.0` binding to avoid exposing remote code execution to the network). Pocket rewrites every inbound request's `Host` / `Origin` to `127.0.0.1:<dsh-port>`, so the fence always sees loopback — **no dsh configuration changes needed**. The proxy auto-starts with the plugin; the public tunnel is on demand (cloudflared forced to HTTP/2 over TCP 443 to bypass blocked QUIC/UDP).
|
|
85
|
-
|
|
86
80
|
## ⚠️ Security (read first)
|
|
87
81
|
|
|
88
82
|
- **DSH can execute code on your computer.** The QR code / URL is the key — **never share it with anyone**.
|
|
@@ -111,17 +105,21 @@ DSH's `/api` browser-trust fence only accepts loopback or `--trusted-host` autho
|
|
|
111
105
|
Such tools take over all traffic and often cut cloudflared's tunnel-edge connections
|
|
112
106
|
(`*.argotunnel.com`, Cloudflare edge IPs), so the tunnel registers but the data plane never connects.
|
|
113
107
|
|
|
114
|
-
**Fix (
|
|
108
|
+
**Fix (try in order, lightest first)**:
|
|
115
109
|
|
|
116
|
-
1.
|
|
110
|
+
1. First **just turn off the proxy's TUN mode** — no need to quit the proxy; this is enough in most cases:
|
|
111
|
+
- Clash: turn off the "**TUN mode**" toggle in Settings (or right-click the menu-bar icon → uncheck TUN mode)
|
|
112
|
+
- Surge: turn off "**Enhanced mode**"; v2ray/sing-box: turn off "**virtual NIC / route takeover**"
|
|
113
|
+
- Then go back to the settings page and click "Enable anywhere" again
|
|
114
|
+
2. If that's not enough, temporarily **fully quit the proxy** (not just close the window: quit Clash from the menu-bar icon; if a
|
|
117
115
|
background service is installed, stop it in the service manager and confirm with `ps aux | grep clash`), then retry.
|
|
118
|
-
|
|
116
|
+
3. Add **DIRECT rules** to the proxy for the tunnel domains and Cloudflare edge (Clash example):
|
|
119
117
|
```yaml
|
|
120
118
|
- DOMAIN-SUFFIX,argotunnel.com,DIRECT
|
|
121
119
|
- DOMAIN-SUFFIX,trycloudflare.com,DIRECT
|
|
122
120
|
- IP-CIDR,198.41.192.0/24,DIRECT,no-resolve
|
|
123
121
|
```
|
|
124
|
-
|
|
122
|
+
4. If the network really can't reach the tunnel, use **LAN mode**: turn on the phone hotspot → connect the computer to it → scan the LAN QR. Same experience, from anywhere.
|
|
125
123
|
|
|
126
124
|
**Other causes**: corporate firewalls / campus networks blocking outbound — ask IT to allow it, or use a hotspot.
|
|
127
125
|
|
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
<h1 align="center">DSH Pocket</h1>
|
|
6
6
|
|
|
7
|
+
<p align="center"><a href="README.en.md">English</a> | <a href="README.md">中文</a></p>
|
|
8
|
+
|
|
7
9
|
<p align="center">
|
|
8
10
|
<a href="https://www.npmjs.com/package/dsh-pocket"><img alt="npm" src="https://img.shields.io/npm/v/dsh-pocket?color=4d6bfe&label=npm"></a>
|
|
9
11
|
<a href="https://www.npmjs.com/package/dsh-pocket"><img alt="downloads" src="https://img.shields.io/npm/dm/dsh-pocket?color=4d6bfe"></a>
|
|
@@ -13,8 +15,6 @@
|
|
|
13
15
|
</p>
|
|
14
16
|
|
|
15
17
|
> 把 **DeepSeek Harness 装进你的口袋**:一个包、一个设置页,手机扫二维码就实时看到电脑上的同一个界面——人在外面也能用。
|
|
16
|
-
>
|
|
17
|
-
> [English](README.en.md) | [中文](README.md)
|
|
18
18
|
|
|
19
19
|
## 这是什么
|
|
20
20
|
|
|
@@ -26,8 +26,6 @@
|
|
|
26
26
|
|
|
27
27
|
DSH Pocket 就是干这个的:**装上它,手机扫个码,就能实时看到并操控电脑上的 DeepSeek Harness 界面**——人在外面也能用。
|
|
28
28
|
|
|
29
|
-
> 原理一句话:`dsh web` 默认只允许本机访问,DSH Pocket 在它前面加一层代理,把手机访问安全地接入(详见[「原理」](#-原理))。
|
|
30
|
-
|
|
31
29
|
实际效果——手机上的界面就是电脑上的界面,实时同步:
|
|
32
30
|
|
|
33
31
|
<p align="center">
|
|
@@ -79,10 +77,6 @@ npx @deepseek-ai/dsh web
|
|
|
79
77
|
|
|
80
78
|
> 更新到新版本:`dsh plugin --profile web update dsh-pocket --latest -w`(跨大版本时 `--latest` 是必须的,`^0.x` 范围不会自动升到 1.x)。
|
|
81
79
|
|
|
82
|
-
## 🧭 原理
|
|
83
|
-
|
|
84
|
-
DSH 的 `/api` 浏览器信任栅栏只认 loopback 或 `--trusted-host`(官方还禁了 `0.0.0.0` 绑定,防止把远程执行代码暴露给网络)。Pocket 把入站请求的 `Host` / `Origin` 统一改写成 `127.0.0.1:<dsh端口>`,栅栏永远看到 loopback——**不需要改 dsh 的任何配置**。代理随插件自动启动,公网隧道按需开启(cloudflared 强制走 HTTP/2/TCP 443,绕开被网络屏蔽的 QUIC/UDP)。
|
|
85
|
-
|
|
86
80
|
## ⚠️ 安全(必读)
|
|
87
81
|
|
|
88
82
|
- **DSH 能执行你电脑上的代码**。二维码/URL 就是钥匙,**请勿把二维码或 URL 发给任何人**
|
|
@@ -111,17 +105,21 @@ DSH 的 `/api` 浏览器信任栅栏只认 loopback 或 `--trusted-host`(官
|
|
|
111
105
|
这类工具会接管全部流量,并常常把 cloudflared 的隧道边缘连接
|
|
112
106
|
(`*.argotunnel.com`、Cloudflare 边缘 IP)掐断,导致隧道注册成功但数据面连不上。
|
|
113
107
|
|
|
114
|
-
|
|
108
|
+
**解决(从轻到重,按顺序试)**:
|
|
115
109
|
|
|
116
|
-
1.
|
|
110
|
+
1. 先**只关闭代理的 TUN 模式**,不用退出代理软件——多数情况这一步就够:
|
|
111
|
+
- Clash:设置里关掉「**TUN 模式**」开关(或右键菜单栏图标 → 取消勾选 TUN 模式)
|
|
112
|
+
- Surge:关「**增强模式**」;v2ray/sing-box:关「**虚拟网卡/路由接管**」
|
|
113
|
+
- 然后回设置页重新点「开启公网访问」
|
|
114
|
+
2. 仍不行就**彻底退出代理软件**(不只是关界面:Clash 要右键菜单栏图标 → 退出;若装有
|
|
117
115
|
后台服务还要在服务管理器里停掉,`ps aux | grep clash` 确认进程消失),再重试
|
|
118
|
-
|
|
116
|
+
3. 给代理加**直连规则**,放行隧道域名与 Cloudflare 边缘(Clash 规则示例):
|
|
119
117
|
```yaml
|
|
120
118
|
- DOMAIN-SUFFIX,argotunnel.com,DIRECT
|
|
121
119
|
- DOMAIN-SUFFIX,trycloudflare.com,DIRECT
|
|
122
120
|
- IP-CIDR,198.41.192.0/24,DIRECT,no-resolve
|
|
123
121
|
```
|
|
124
|
-
|
|
122
|
+
4. 网络实在不通时,改用**局域网模式**:手机开热点 → 电脑连手机热点 → 扫局域网码,
|
|
125
123
|
效果完全一样(人在外面也能用)
|
|
126
124
|
|
|
127
125
|
**其他可能**:企业防火墙/校园网拦截出站;此时请让 IT 放行或改用热点。
|
package/lib/index.js
CHANGED
|
@@ -36,9 +36,9 @@ const restartNoticeRel = join('dsh-pocket', 'restarted.json');
|
|
|
36
36
|
function restartNoticePath() {
|
|
37
37
|
return join(process.env.DSH_HOME ?? join(homedir(), '.dsh'), restartNoticeRel);
|
|
38
38
|
}
|
|
39
|
-
function readRestartNotice() {
|
|
39
|
+
async function readRestartNotice() {
|
|
40
40
|
try {
|
|
41
|
-
const raw = JSON.parse(readFile(restartNoticePath(), 'utf8'));
|
|
41
|
+
const raw = JSON.parse(await readFile(restartNoticePath(), 'utf8'));
|
|
42
42
|
if (!raw?.at) return null;
|
|
43
43
|
if (Date.now() - raw.at > 30 * 60 * 1000) return null; // 30 分钟后过期
|
|
44
44
|
return raw;
|
|
@@ -162,4 +162,4 @@ export function apply(ctx, config = {}, internals = {}) {
|
|
|
162
162
|
}, 'dsh-pocket: stop proxy, tunnel and push');
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
export { name, inject };
|
|
165
|
+
export { name, inject, readRestartNotice };
|
package/lib/web-rpc.js
CHANGED
|
@@ -28,7 +28,7 @@ export function installPocketRpc(ctx, { service, push, log = console, runUpdate
|
|
|
28
28
|
// status 响应:redact 后的服务状态 + 重启提示(重启后 30 分钟内有效)
|
|
29
29
|
const statusPayload = async () => {
|
|
30
30
|
let notice = null;
|
|
31
|
-
try { notice = restartNotice?.() ?? null; } catch { notice = null; }
|
|
31
|
+
try { notice = (await restartNotice?.()) ?? null; } catch { notice = null; }
|
|
32
32
|
return ok({ ...redactStatus(await service.status()), restartNotice: notice });
|
|
33
33
|
};
|
|
34
34
|
|
package/package.json
CHANGED