dsh-model-proxy-switch
Verifieddsh-model-proxy-switch · v1.0.0 · MIT · Web UI
Sidebar switch that routes model API and model-list requests through an HTTP proxy (follows the system proxy by default); off restores direct connections. Optional per-host allowlist.
Install
dsh plugin add dsh-model-proxy-switch Confirm the layer applied with dsh --profile default --dump-config — see the install guide.
Source
Tags
Creators
Readme
dsh-model-proxy-switch
English | 中文
A sidebar switch for DeepSeek Harness (dsh) that routes outbound requests — model API calls, model-list discovery, web search, HTTP MCP — through a local HTTP proxy, and restores direct connections when switched off.
Why
Some model relays are unreachable from a direct connection (the TLS handshake is reset), while the operating system's proxy reaches them fine. The harness resolves its proxy policy once at launch from the launch environment and never re-reads it, so flipping the OS proxy later does nothing. This plugin installs the same policy at runtime, on demand, as a toggle.
Features
- One switch in the sidebar — a new "Proxy" entry next to Plugins, opening a small panel with the toggle, the active proxy address, and where it came from.
- Follows the system proxy by default (
proxy: auto) — on Windows it reads theInternet Settingsregistry values, so swapping proxy software or ports needs no edit. A fixed URL can be set in the plugin config instead. - Optional per-host allowlist — leave it empty to route every external address, or list domains (comma-separated, subdomains included) so only they go through the proxy. Loopback always stays direct.
- No restart, no
.env— toggling installs/disposes the process-wide dispatcher live; the choice persists across restarts in~/.dsh/model-proxy.json. - Self-contained — the proxy installer and its
undicidependency are vendored, so the package has no runtime dependencies.
Install
dsh plugin --profile <profile> add dsh-model-proxy-switch
or from the Plugins page: Add plugin → package name dsh-model-proxy-switch, a Git URL, a tarball, or a local directory.
Usage
- Open Proxy in the sidebar.
- Flip Use proxy on. The address line shows the detected proxy and its source (
from system settings/from registry/from plugin config). - Optionally fill Only proxy these hosts (e.g.
api.example.com) and save — everything else then stays direct.
Configuration (bundle cordis.patch.yml or the row config): proxy (auto or an http(s):// URL), bypass (extra direct hosts), hosts (initial allowlist).
Privacy: the plugin routes traffic you ask it to route and writes one small state file in the harness home. It collects nothing and calls nowhere on its own.
中文
一个 DeepSeek Harness(dsh)的侧栏开关插件:开启后,模型 API、获取模型列表、网页搜索、MCP 等出网请求改走本地 HTTP 代理;关闭即恢复直连。
解决什么问题
有些模型中转站直连会被重置(TLS 握手被掐),但系统代理能通。而 DSH 只在启动时读一次代理环境变量,之后改系统代理没有用。这个插件把同样的代理策略做成了运行时可开关的按钮。
功能
- 侧栏一个开关:「插件」旁边多出「代理」入口,面板里有开关、当前代理地址和来源标注。
- 默认跟随系统代理(
proxy: auto):Windows 下读注册表的 Internet Settings,换代理软件或端口不用改插件;也可以在配置里写死地址。 - 域名白名单(可选):留空表示所有外部地址都走代理;填入域名(逗号分隔,含子域名)后只有这些域名走代理。本机回环永远直连。
- 不用重启、不用改 .env:切换即时装卸全局 dispatcher,选择持久化在
~/.dsh/model-proxy.json。 - 零依赖:代理安装器和
undici已内置于包内。
安装
dsh plugin --profile <profile> add dsh-model-proxy-switch
或在插件页 添加插件,填包名 dsh-model-proxy-switch、Git 地址、压缩包或本地目录。
使用
- 打开侧栏「代理」。
- 打开「使用代理」,地址行会显示检测到的代理及来源(跟随系统代理 / 注册表记录 / 插件配置)。
- 可选:在「只对这些域名走代理」里填域名(如
api.wufannao.cc.cd)并保存,其余流量保持直连。
配置项(bundle 的 cordis.patch.yml 或行配置):proxy(auto 或 http(s):// 地址)、bypass(额外直连域名)、hosts(初始白名单)。
隐私:插件只按你的要求转发流量,并在 harness home 写一个很小的状态文件;不收集、不上报任何数据。
License
MIT