dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
DeepSeek Harness(DSH)的出站代理开关。Clash 开着就走 Clash,关掉就自动直连,界面上一键切换,不用重启 DSH。
Outbound proxy switch for DeepSeek Harness: a local router picks Clash or direct per mode, with an in-UI switch. No DSH restart.
0.2.1-rc.2(Windows 11)DSH 的代理策略是启动器在插件加载之前从 .env 一次性安装的:
.env 写成 https_proxy=http://127.0.0.1:7897(Clash),那 Clash 一关,DSH 全线断网;本插件让 .env 指向它自己的本地路由器,由路由器在每次连接时决定出口:
.env ──▶ 127.0.0.1:17897(本插件的路由器)
├─ auto : Clash 可达 → 走 Clash;不可达 → 直连
├─ direct : 直连
└─ clash : 走 Clash(不自动回退)
顺带的好处:DSH 看到 HTTPS_PROXY 就会走代理,并跳过私有地址校验(域名交给代理解析),
所以 Clash TUN + fake-ip 环境下 web_fetch 报 non-public IP 的问题也一并解决了。
从 npm 安装(推荐,最简单):
dsh plugin add dsh-proxy-switch@0.3.1
也可以直接锁定 git tag(不依赖 npm):
dsh plugin add "git+https://github.com/tonyAmadeus/dsh-proxy-switch.git#v0.3.1"
想要更严格,可以把 # 后面换成仓库首页显示的 commit hash,commit 完全不可变。
编辑 ~/.dsh/.env(Windows:C:\Users\<user>\.dsh\.env),加入:
http_proxy=http://127.0.0.1:17897
https_proxy=http://127.0.0.1:17897
然后重启一次 DSH(.env 只在启动时读取)。
这两行是必须的:不配的话插件不会参与选路,Clash 关掉时 DSH 照样断网。 端口
17897若在插件配置里改过,这里要同步改。
插件提供两个入口:
| 模式 | 行为 | 何时用 |
|---|---|---|
| 自动(默认) | 探测 Clash(1 秒缓存):在线 → 走 Clash;离线 → 直连 | 日常 |
| 直连 | 一律直连 | 明确不开 Clash |
| 走 Clash | 一律走 Clash,不自动回退 | 必须确保走节点 |
切换即时生效——路由器在每条连接上重读模式文件,不需要重启 DSH。
状态行会显示 Clash 在线/未运行、路由器在线/离线。
设置页底部有 「在聊天框下方显示插件按钮」 开关(默认开启):
开关状态保存在 $DSH_HOME/proxy-ui.json,重启 DSH 后保持;两处入口的模式状态是共享的。
默认配置在插件的 cordis.patch.yml。要覆盖,在 profile 的 cordis.patch.yml
里加一条同 id 的 patch 条目(profile 是 ~/.dsh/profiles/<名字>/):
- id: dsh-proxy-switch
config:
routerPort: 17897
clashPort: 7897
| 字段 | 默认值 | 说明 |
|---|---|---|
routerPort | 17897 | 本地路由器监听端口(.env 要指向它) |
clashPort | 7897 | Clash / Mihomo 的混合端口(Clash Verge Rev 默认 7897,原版 Clash 常见 7890) |
modeFile | $DSH_HOME/proxy-mode.txt | 模式文件(auto / direct / clash) |
logFile | $DSH_HOME/dsh-proxy-switch.log | 运行日志(超 512KB 自动截断) |
uiFile | $DSH_HOME/proxy-ui.json | 界面状态(聊天框按钮是否显示) |
$DSH_HOME 默认是 ~/.dsh,可用环境变量覆盖。
# 路由器是否在监听
Get-NetTCPConnection -LocalPort 17897 -State Listen
# 日志(Windows 默认路径)
Get-Content "$env:USERPROFILE\.dsh\dsh-proxy-switch.log" -Tail 20
# 手动经路由器抓网页(应返回 200)
curl.exe -sS -x http://127.0.0.1:17897 -o NUL -w "%{http_code}`n" https://example.com
# 强制切直连(等价于在 设置 → 代理 里选「直连」)
Set-Content -NoNewline "$env:USERPROFILE\.dsh\proxy-mode.txt" direct
owner process ... gone, exiting:上一轮 DSH 退出后路由器按约定自我清理,属正常。.env 里那两行在;再确认模式不是「走 Clash」而 Clash 没开。dsh plugin remove dsh-proxy-switch
然后删掉 .env 里那两行并重启 DSH。
clashPort。ELECTRON_RUN_AS_NODE 拉起,DSH 退出约 2 秒后自行退出,不留孤儿进程。@deepseek-ai/dsh-http-proxy(启动器一次性安装,插件不可改)@deepseek-ai/dsh-plugin-market-indexMIT © 2026 tonyAmadeus