khiqwq/dsh-system-proxy

DSH 主机插件 - 智能出站 HTTP(S) 路由:命名代理(http/https/socks4/4a/5/5h),按主机/提供商/插件规则,直连优先回退与健康记忆(全局 fetch + node http/https)

Project Overview项目介绍

This is a native DSH plugin for outbound network routing, built exclusively for DeepSeek Harness. To install from source, you need to clone the repository, run npm install, npm test, npm run build, then install the package to your DSH profile directory and add it to your profile's bundle list. Once installed correctly, it takes over all fetch requests in the DSH main process, and can optionally wrap node:http and node:https requests to apply routing rules. It supports multiple proxy protocols including HTTP, HTTPS, SOCKS4, SOCKS4a, SOCKS5, and SOCKS5h, and allows users to define custom routing rules based on host, provider, or plugin.

Regular users can complete all configuration through the interactive settings card in the DSH settings page after installation, no manual file editing is required. Configuration drafts are saved locally in the browser, so they won’t be lost even if you close or collapse the card. Developers can also edit the cordis.patch.yml file in the DSH profile directory directly to apply custom configurations. This plugin is designed for users who need to control outbound network routing for DSH, such as those who need to split traffic for different APIs or bypass network restrictions.

This plugin is open-sourced under the MIT License, maintained by the community, and is not an official DeepSeek product. There are a few limitations users should note: SOCKS4/4a does not support IPv6 targets, and such requests will throw an explicit error instead of failing silently. You should not load multiple competing transport wrapper plugins in the same DSH process, as this can cause conflicts. Incorrect proxy configuration may lead to request failures, data leaks, or other issues, so users need to review the configuration and assume all potential usage risks.

这是专为 DeepSeek Harness (DSH) 开发的原生出站网络路由插件,它在DSH主进程中统一接管fetch请求,也可选择接管node:http/node:https请求,能够根据目标主机、调用上下文在直连、多种代理之间选择路由,支持直连优先故障回退、每主机健康记忆、内网端点默认保护等功能,支持多种代理协议和自定义路由规则。

对于普通用户,安装到带设置服务的DSH配置后,就可以在设置页面的插件配置卡中完成所有操作,不需要手动修改配置文件,配置草稿会保存在浏览器本地,关闭或折叠卡片也不会丢失。对于开发者,也可以直接修改profile目录下的cordis.patch.yml完成自定义配置,本插件适合需要管控DSH出站请求路由的用户使用。

本插件采用MIT许可证开源,由社区维护,不属于DeepSeek官方产品。使用中需要注意,同一进程不要加载多个互相竞争的传输包装插件,错误的代理配置可能导致请求失败、信息泄露等问题,用户需要自行承担使用风险。当前版本SOCKS4/4a不支持IPv6目标地址,这类请求会明确报错,不会静默处理。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 4 stars - very few users, little community feedback星标只有 4,几乎没人在用,遇到问题缺少社区反馈
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 dsh-system-proxy

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

READMEREADME

dsh-system-proxy

DeepSeek Harness(DSH)的出站网络路由插件。它在 DSH 主进程中统一接管 fetch 与可选的 node:http / node:https 请求,根据目标主机及显式调用上下文,在直连、HTTP(S) 代理和 SOCKS4/4a/5/5h 代理之间选择线路;支持直连优先的故障回退、逐跳重定向重新决策、每主机健康记忆,以及内网/云元数据端点的默认保护。

当前版本已实现下述全部能力并通过 npm test(81 项断言 + 真实 Cordis loader 挂载/热重载验证)。

目标能力

  • HTTP、HTTPS、SOCKS4、SOCKS4a、SOCKS5、SOCKS5h 代理;
  • 多个具名代理(named proxies);
  • 按 host、provider、plugin 路由;
  • direct、proxy、fallback、block 四种动作;
  • 直连失败或延迟过高时使用代理保底;
  • 每目标 EWMA 延迟、失败冷却(cooldown)与健康记忆;
  • 显式 provider/plugin 上下文,不伪造调用方身份;
  • 代理凭据脱敏、安全日志和热重载恢复。

工作原理

插件加载后:

  1. 包装 globalThis.fetch,按规则选择直连或代理 dispatcher;
  2. patchNodeHttp: true 时包装 node:http / node:https 的 request 与 get;
  3. 用 AsyncLocalStorage 传递显式 provider / plugin 信息;
  4. 为 fallback 目标保存直连 EWMA 延迟及失败冷却;
  5. 插件销毁或热重载时还原自己安装的包装器,并关闭代理 Agent。

这是进程级全局补丁。同一进程内不应同时加载多个相互竞争的传输包装插件;本插件在还原时只恢复仍指向自身包装器的全局对象,不覆盖后来安装的包装器。

安装

源码仓库:https://github.com/khiqwq/dsh-system-proxy

从源码安装:

git clone https://github.com/khiqwq/dsh-system-proxy.git
cd dsh-system-proxy
npm install
npm test
npm run build
npm run client-test

cd "$env:DSH_HOME\profiles\<name>"
npm install <dsh-system-proxy 源码目录的绝对路径>
# 将 "dsh-system-proxy" 加入 package.json 的 dsh.profile.bundles

发布后可使用:

dsh plugin --profile <name> add dsh-system-proxy

本包声明了 dsh.bundle.patch,安装为 DSH profile bundle 后会提供 system-proxy loader entry。

配置

交互式配置

安装到带有 Settings 服务的 DSH profile 后,插件会以 system-proxy 命名空间注册交互式配置,并通过包内 ./client Web bundle 在 DSH Settings → 插件页面显示可折叠的 系统代理 / System Proxy 配置卡。卡片沿用官方 PluginCard 的紧凑层级、原生 DSH CSS variables、field grid、状态 badge 与 primary/secondary actions;中文 locale 自动显示中文,其他 locale 使用英文 fallback。双语词典由 @deepseek-ai/dsh-client-locale 注册并实时订阅切换。卡片可编辑基础开关、代理 URL、passwordRef 和只写密码;所有输入先保存在浏览器本地草稿中,折叠不会丢失草稿,只有回车或点击 保存并加密 / Save and encrypt 才写入。URL 是普通可见 endpoint 字段并明确拒绝 user:pass@ userinfo;真正的密码输入使用 type=password。命名空间不可用时卡片不会出现;只读状态和保存失败会在卡片内明确显示。保存后插件会串行停止旧传输包装并按最新配置热重装,无需手工编辑 patch 或重启主进程。loader entry 中的 config 作为 base 层:没有用户设置时保持原行为,清除用户覆盖后也会回落到该 base。

代理密码必须优先使用 passwordRef:隐式 default 代理默认使用 DSH_PROXY_PASSWORD(也可改成其他环境变量格式标识符),保存时先写 credential,再写 passwordRef 与其他 settings。保存后密码草稿立即清空,页面重新打开时只通过 credentials.describe() 获取“已配置/未配置”,不会调用 resolve()、回填原文、显示首尾或显示 DPAPI 密文;密码仅通过单向 credentials.set() 提交,绝不会保存到 settings。配套的 dsh-credentials-system 使用 Windows 当前用户绑定的 DPAPI 密文存储,并替换默认的明文 dsh-credentials-local。role("secret") 只负责页面/API 脱敏,本身不等于磁盘加密。

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

← 上一个 Prev dsh-eva-theme-plugin 下一个 Next dsh-github-workbench →