JinSuperOfficial/dsh-proxy-switcher ↗★ 0
dsh-proxy-switcher
Hot-switch the outbound proxy of a running DeepSeek Harness (dsh): direct / system-env / custom proxy, multiple saved proxies, switchable from the dsh settings page with no restart. 适合需要在不同网络代理环境间快速切换且不想重启应用的用户。
설치
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:JinSuperOfficial/dsh-proxy-switcher6. 配置
配置文件:$DSH_HOME/proxy-switcher.json(可用 DSH_PROXY_SWITCHER_CONFIG 覆盖)。
示例见 config.example.json。
字段:enabled · mode(direct|system|custom) · activeProfile · profiles[]
(id,name,protocol,host,port,username,password,passwordEnv,noProxy) ·
noProxy · bypassLoopback · probeUrl · timeoutMs · onMissingProfile(block|direct) ·
fallback{mode,failureThreshold} · historyLimit。
优先级
运行时设置(设置页 / /proxy / API) > 环境变量 > 配置文件 > 默认值
环境变量:
| 变量 | 作用 |
|---|---|
DSH_PROXY_SWITCHER_ENABLED | 1/0 总开关 |
DSH_PROXY_SWITCHER_MODE | direct / system / custom / off(=关闭代理) |
DSH_PROXY_SWITCHER_PROFILE | 选择已保存代理的 id |
DSH_PROXY_SWITCHER_URL | 直接用一条代理 URL(最高优先,隐式 custom) |
DSH_PROXY_SWITCHER_NO_PROXY | 覆盖 no_proxy |
DSH_PROXY_SWITCHER_CONFIG | 配置文件路径 |
其它管理方式
/proxy命令:status·on·off·direct·system·use·temp·test [id]- 插件 API(其它 Cordis 插件可用):
ctx.proxySwitcher.status()/config()/configure(patch)/applyRuntime(patch)/reset()/test(candidate) - HTTP(设置页用的就是它,同源校验):
GET state|status,POST apply|reset|reapply|test于/dsh-proxy-switcher/*