tonyAmadeus/dsh-proxy-switch ↗★ 0
dsh-proxy-switch
DSH 出站代理开关:本地路由器按模式在 Clash 与直连之间自动选路,界面一键切换,无需重启。Outbound proxy switch for DeepSeek Harness: local router picks Clash or direct per mode, with an in-UI switch. 在界面提供直连与Clash代理切换,适合需要灵活控制网络出站流量的用户。
Other repositories with this package name
Install
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:tonyAmadeus/dsh-proxy-switchREADME
Read the full README ↗使用
对话输入框旁会多一个 🌐 按钮:
| 模式 | 行为 | 何时用 |
|---|---|---|
| 自动(默认) | 探测 Clash(1 秒缓存):在线 → 走 Clash;离线 → 直连 | 日常 |
| 直连 | 一律直连 | 明确不开 Clash |
| 走 Clash | 一律走 Clash,不自动回退 | 必须确保走节点 |
切换即时生效——路由器在每条连接上重读模式文件,不需要重启 DSH。
面板底部会显示 Clash 在线/未运行、路由器在线/离线。
配置
默认配置在插件的 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 自动截断) |
$DSH_HOME 默认是 ~/.dsh,可用环境变量覆盖。