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. 适合需要在不同网络代理环境间快速切换且不想重启应用的用户。

패키지
dsh-proxy-switcher
호환성
미검증
Harness peer 범위
^0.2.0-rc.1
Cordis peer 범위
^4.0.4
버전
1.0.0
라이선스
MIT
최근 업데이트
2026. 10. 2.

설치

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:JinSuperOfficial/dsh-proxy-switcher

6. 配置

配置文件:$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_ENABLED1/0 总开关
DSH_PROXY_SWITCHER_MODEdirect / 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/*