tr1v3r/dsh-proxy 预览 preview

tr1v3r/dsh-proxy

Runtime-switchable outbound proxy plugin for the DeepSeek Harness — hot-reload HTTP(S)/SOCKS5 routing via one settings section

Project Overview项目介绍

@tr1v3r/dsh-proxy is a DeepSeek Harness native plugin shipped as a bundle that integrates through the dsh.profile.bundles field in the target profile's package.json. It hijacks undici's well-known global dispatcher slot read by globalThis.fetch, redirecting every in-process outbound request — LLM providers reached via pi-ai, the dedicated dsh-llm-deepseek route, web_search/web_fetch calls, and streamable-http MCP servers — through an HTTP(S) CONNECT or SOCKS5 proxy. Installation requires editing ~/.config/dsh/profiles/<name>/package.json to add the dependency and merge the bundle name, then running dsh plugin --profile <name> install --no-frozen-lockfile, followed by a single DSH restart to register it; from that moment onward no restarts are needed again, since switching happens entirely through settings or hot-reloaded YAML.

The plugin exposes three runtime modes — manual, direct, and system — toggleable from the Web Settings → General → Network proxy control or by editing the dsh-proxy entry in cordis.patch.yml. manual mode routes via the configured proxy URL with an optional noProxy matcher (undici-style bare entries, host:port, * wildcard, and dot-boundary semantics); system mode follows ambient HTTP_PROXY/HTTPS_PROXY/ALL_PROXY/NO_PROXY env vars and falls back to macOS System Settings proxy (scutil --proxy), re-detected on each save rather than continuously polled. With exportEnv: true (default) the same variables are propagated into the dsh process so child processes spawned after a switch — bash-tool curl/git, stdio MCP servers — follow the new route, while user-set boot env vars are preserved and restored on disable. The target audience is developers and operators behind firewalls or VPN fronts who need instant proxy rerouting without restarting the host application, and the demo node scripts/demo.mjs shows the dispatcher switching mid-flight.

Dependencies include DSH ≥ 0.1.7-rc.1, because the boot probe (scripts/boot-probe.mjs) and runtime rely on createRuntimeResolution / PluginPackages exports that older builds lack; with DSH 0.1.5.x the probe fails with TypeError: createRuntimeResolution is not a function, which can be sidestepped by pointing DSH_ROOT at a scratch install such as npm install --prefix /tmp/dsh-probe-root @deepseek-ai/dsh@0.1.7-rc.1. Unit and end-to-end tests run via npm test; npm install is otherwise sufficient. Credentials embedded as user:pass@ in the proxy URL are stored plaintext in cordis.patch.yml and settings persistence, and with exportEnv: true they leak into child process environments visible to ps -E or /proc/<PID>/environ for the same user, so sensitive setups should point at a local unauthenticated proxy. Limits: loopback destinations bypass by default (bypassLoopback: false overrides), the pi-ai Bedrock route is handled by the AWS SDK rather than this plugin, the built-in browser host runs as a separate process and needs its own proxy configuration, undici's SOCKS5 agent remains experimental upstream, retired dispatchers are force-destroyed after a 30-second grace that can interrupt long streams, and system mode does not cover Windows registry, Linux-desktop settings, or PAC. License is MIT.

@tr1v3r/dsh-proxy 是一个 DeepSeek Harness 原生插件,以 bundle 形式随 profile 装载。它劫持 globalThis.fetch 读取的 undici 全局调度器槽位,把进程内发出的所有出站请求——LLM 提供商、web_search/web_fetch、streamable-http MCP——统一重定向到 HTTP(S) CONNECT 或 SOCKS5 代理。安装方式为:在目标 profile 目录的 package.json 中把 @tr1v3r/dsh-proxy 加入 dependencies,并在 dsh.profile.bundles 追加该包名,再执行 dsh plugin --profile <name> install --no-frozen-lockfile,随后重启 DSH 一次挂载插件。

插件提供 manual、direct、system 三种运行模式,可在 Web Settings → General → Network proxy 控件或 cordis.patch.yml 的 dsh-proxy 条目中即时切换,无需重启进程。manual 模式按配置中的 proxy 与 noProxy 路由;system 模式跟随环境变量或 macOS scutil --proxy 检测结果,每次设置保存时重新探测;exportEnv: true(默认)会把 HTTP_PROXY 等变量导出到 DSH 进程,使切换后新建的子进程同样走代理,旧进程保持原环境。典型用户是在受限网络环境下需要随时切换代理、又不愿反复重启 DSH 的开发者与运维人员。

依赖方面,需 DSH ≥ 0.1.7-rc.1(否则 createRuntimeResolution 缺失导致报错),SOCKS5 agent 上游仍标为实验性。凭证以明文存入 cordis.patch.yml,敏感凭据建议指向本地免认证代理。system 模式尚未覆盖 Windows 注册表、Linux 桌面与 PAC;pi-ai Bedrock 路由由 AWS SDK 自管;内置浏览器宿主是独立进程,需另行配置。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:tr1v3r/dsh-proxy

把 tr1v3r/dsh-proxy 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-proxy — runtime-switchable outbound proxy for DSH

中文说明见 README.zh.md。

npm license DSH Market

demo: changing proxy modes reroutes outbound requests instantly

@tr1v3r/dsh-proxy is a DeepSeek Harness plugin that routes every in-process outbound request — LLM providers, web_search / web_fetch, streamable-http MCP — through an HTTP(S) CONNECT or SOCKS5 proxy, and lets you flip the proxy on, off, or to another server at runtime, with zero restarts, either from the Web Settings → General → Network proxy control or by editing the dsh-proxy entry in the profile's cordis.patch.yml (hot-reloaded). The demo above shows the routing engine: node scripts/demo.mjs after install.

How it works

DSH and pi-ai issue requests through globalThis.fetch, which reads undici's well-known global dispatcher slot (Symbol.for('undici.globalDispatcher.1')). The plugin owns that slot:

  • http(s):// proxy → EnvHttpProxyAgent (CONNECT tunneling for https)
  • socks5:// proxy → undici's built-in Socks5ProxyAgent (URL credentials supported; socks5h:///socks:// normalize to it; DNS resolves remotely)
  • noProxy rules → both paths route through one RoutingDispatcher, so HTTP and SOCKS share identical matcher semantics (undici-style: bare entries match the host and dot-boundary subdomains; host:port pins a port; * bypasses everything; a leading dot or *. prefix is accepted as a synonym of the bare entry). In manual mode, ambient NO_PROXY/HTTP_PROXY env vars are deliberately ignored by the dispatchers — exported env only steers child processes, so in-process routing is fully determined by the profile entry config. system mode is the opposite: it follows the ambient proxy — HTTP_PROXY/HTTPS_PROXY/ALL_PROXY/NO_PROXY env vars, falling back to the macOS System Settings proxy (scutil --proxy) — re-detected each time the section is applied, not continuously polled.

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev BigPlan 下一个 Next angelina-web-deco →