dsh-proxy-router

DSH PLUGIN浏览器与联网

仓库 yangzhe1991/dsh-proxy-router · npm @yangzhe1991/dsh-proxy-router

浏览器与联网 L5 · 运行验证通过 安全审查:低风险 可信度:金 可安装插件
安装这个插件

为 DeepSeek Harness 提供本地分流代理:只有命中规则的被墙域名走上游代理,其余直连,上游地址与规则在 Web 设置页热生效。

一句话选型结论

按资料字段整理

dsh-proxy-router 是浏览器与联网类的 DSH 可安装插件,验证等级 L5 · 运行验证通过,安全审查为低风险,列出 5 项功能,有可直接复制的安装命令。验证通过不等于安全:插件会读写文件、执行命令或联网,装前先到仓库确认它做了什么;涉及密钥或系统权限的,建议先在隔离环境试装。

分类浏览器与联网 收录类型可安装插件 验证等级L5 · 运行验证通过 安全审查低风险
验证等级 L5 L5 · 运行验证通过
GitHub 星标 1 复刻 0 · 未关闭 issue 0
最近更新 2026-09-28 创建于 2026-09-12
README 15.2 KB 正文体量,越大说明说明书写得越细

安装

可安装插件
在 DSH 里执行,装完用 dsh plugin list 确认已挂上;标了 L4 / L5 的命令已在沙盒里真实跑通
dsh plugin --profile web add @yangzhe1991/dsh-proxy-router
  1. 1
    确认版本与运行环境

    兼容的 DSH 版本为 0.2.0-rc.2 等 5 个;版本不匹配时安装会报错。

  2. 2
    执行安装命令

    在 DSH 里执行上面的命令;多包仓库要注意区分具体子包名,别装错包。

  3. 3
    确认已挂载

    用 dsh plugin list 查看列表里是否出现这个插件,出现即挂载成功。

  4. 4
    试跑并检查权限

    加载后跑一个最小用例,确认它能正常工作;同时看它申请了哪些文件、命令或网络权限。

兼容 DSH 版本0.2.0-rc.2 等 5 个版本版本不匹配时安装会报错
Node.js 要求未标注来自仓库 package.json 的 engines 字段
前置依赖无需要同时安装的同级依赖
npm 包名@yangzhe1991/dsh-proxy-router可用 npm view 查看包信息

能做什么

5 项功能
字段来自项目仓库与公开索引,中文说明由本站标注

dsh-proxy-router:为 DeepSeek Harness 做按域名分流的本地路由代理

  • 被墙域名走代理,其余直连
  • 本地规则 + 远程订阅 + 内置种子
  • Web 设置页改上游,热生效
  • 覆盖 fetch、web_fetch 与 bash 子进程
  • 状态面板显示命中统计

适用场景

联网搜索

上游标签

dsh-plugingfw

验证等级与安全审查

L5 · 运行验证通过
自动化流程结论,不是人工审核
验证等级L5 · 运行验证通过在 dsh 沙盒中完成安装与运行冒烟——装得上、跑得起来
安全审查低风险静态分析结论,未标注不代表已通过审查
仓库健康度活跃按仓库活跃度与最近更新时间给出
可信度金综合仓库活跃度与验证结果

上面的结论来自上游最近一次自动化验证(2026-10-08): 同一套检查会在插件发新版后重跑,页面显示的是最新一次的逐项结果。

逐项检查结果

L1 · 已找到 ✓ 通过
  • L1.0_DEFAULTED_FROM_L3 由 L3 推定 默认通过——L3 安装规范已通过(全库 L3 扫描策略)
L2 · 结构化 ✓ 通过
  • L2.0_DEFAULTED_FROM_L3 由 L3 推定 默认通过——L3 安装规范已通过(全库 L3 扫描策略)
L3 · 安装规范 ✓ 通过
  • L3.1_INSTALL_COMMAND_PARSED 安装命令已解析 方式:安装规范解析
  • L3.2_DSH_VERSION_DECLARED DSH 版本已声明 方式:DSH 版本声明
L4 · 安装已测 ✓ 通过
  • L4.1_INSTALL_EXECUTED_CONFINED 受限沙盒内执行安装 方式:沙盒安装执行
  • L4.2_INSTALL_SUCCESS 沙盒安装成功 方式:沙盒安装执行
  • L4.3_ARTIFACT_CONFIRMED 安装产物已确认 方式:沙盒安装执行
L5 · 运行已测 ✓ 通过
  • L5.1_INSTALL_PASSED_SANDBOXED 沙盒安装通过 方式:沙盒安装执行
  • L5.2_WEB_BOOT_READY Web 启动就绪 方式:Web 启动
  • L5.3_HTTP_SERVED HTTP 服务响应 方式:HTTP 请求
  • L5.4_PLUGIN_INVENTORY_ACTIVE 插件清单中已激活 方式:插件清单查询

风险详情

  • 审查结论 通过
  • 结论说明 vet 静态分析未发现可疑行为,判定为干净(clean)。
  • 风险计数 严重 0 / 高 0 / 中 0
  • 风险详情 未发现严重或警告级问题。

选择建议

装之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 验证等级 L5:安装和运行都在沙盒里跑通过,装完能直接用的概率高。
  • 静态安全审查为低风险,没有发现明显可疑行为。
  • 有可直接复制的安装命令,不用自己翻文档找入口。
  • 标注了兼容的 DSH 版本(0.2.0-rc.2 等 5 个),按版本装不容易报错。
  • 列出了 5 项功能,能直接看出它解决什么问题。

先想清楚的地方

  • 没有声明 Node.js 版本要求,版本不匹配可能装不上。
  • 验证通过不等于安全:插件会读写文件、执行命令或联网,装前先到仓库确认它做了什么。

更适合

  • 需要在浏览器与联网场景里给 DSH 补能力的人。
  • 想装完就能用、不想自己排依赖的人。
  • 能接受在本地装依赖、愿意自己确认权限的人。

不太适合

  • 只使用 DSH 官方内置能力、不接受第三方插件的人。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
插件验证等级安全审查星标兼容版本安装命令
dsh-proxy-router当前 L5 · 运行验证通过 低风险 1 0.2.0-rc.2 等 5 个 有
dsh-our-free-model L3 · 安装规范通过 低风险 8,796 未标注 有
dsh-web L3 · 安装规范通过 低风险 8,549 未标注 无
BrowserSkill L4 · 沙盒安装通过 低风险 8,456 未标注 有
dsh-pocket L5 · 运行验证通过 低风险 1,656 0.2.0-rc.2 等 12 个 有
Browser4 L4 · 沙盒安装通过 中风险 1,152 未标注 有

仓库档案

浏览器与联网
字段来自项目仓库与公开索引,中文说明由本站标注
作者 / 维护方yangzhe1991仓库 dsh-proxy-router · 默认分支 main
分类浏览器与联网search
收录类型可安装插件声明了 dsh.bundle、可用 dsh plugin add 安装的条目
开发语言TypeScript仓库主语言
许可证MIT商用或二次分发前请确认条款原文
星标 / 复刻 / issue1 / 0 / 0收录时的数值,非实时
创建 / 更新2026-09-12 · 2026-09-28最后推送 2026-09-28
本站收录2026-09-14首次进入本站目录的时间

README 全文

15.2 KB
作者原文,中文版优先;只做安全转义,不改内容

dsh-proxy-router

English | 中文




A routing-proxy plugin for DSH (DeepSeek Harness): only rule-matched blocked domains go through the upstream proxy — everything else (domestic sites, LAN addresses, unknown hosts) connects directly. Its settings live in the Web settings page.

The motivation is mundane: once you start dsh with export https_proxy=... http_proxy=... all_proxy=..., even api.deepseek.com and www.baidu.com take a detour through the proxy. This plugin turns "when should this go through the proxy" into a maintainable rule table, and "who is the upstream" into a setting you can change any time.


What it covers

Everything outbound first hits the plugin's local routing proxy, which then decides where it goes:

Outbound source Notes
Main-process fetch() LLM API (api.deepseek.com), web_search, MCP, plugin HTTP calls
web_fetch tool shares one policy with the main process via the host's proxyRouteFor()
bash subprocesses curl, git, npm/pnpm — inherit the same route through http_proxy + NODE_USE_ENV_PROXY

How it works

DSH main process fetch / web_fetch / bash subprocesses
│  the plugin repoints the host's http(s) proxy at the local router
▼
Local routing proxy (built in, bound to 127.0.0.1:17890)
├── matches a proxy rule → upstream proxy (the address from the configuration page)
└── everything else (default) → direct connection

Three rule layers, first match wins:

  1. Local rules file (~/.dsh/proxy-router/rules.txt) — your own additions/removals, hot-reloaded
  2. Remote blocklists (default: Loyalsoldier/clash-rules gfw.txt + greatfire.txt via jsDelivr, cached, refreshed every 24h)
  3. Built-in seed list — ~140 high-frequency blocked domains, for a first offline start
  4. No match at all → defaultRoute (default: direct)

Loopback and LAN addresses always go direct (127.0.0.0/8, 10/8, 172.16/12, 192.168/16, 169.254/16, 100.64/10, IPv6 ULA/link-local, plus single-label hostnames such as nas) — they are never handed to the upstream proxy.

Install

dsh plugin --profile web add @yangzhe1991/dsh-proxy-router

Then restart dsh web.

> It starts switched off. The master switch (below) defaults to false: the plugin binds no port
> and never touches the host proxy policy, so your networking behaves exactly as before it was installed.
> To use the router, open Settings → 分流代理 and flip the switch.

> For local development, install with link:: set "@yangzhe1991/dsh-proxy-router": "link:/path/to/repo" in ~/.dsh/profiles/web, run pnpm install, restart.

Configuration page (the recommended way)

After the restart, open Settings in the sidebar → 分流代理 (Proxy Router) — it is ordered after every shipped section. The plugin registers itself into the settings page's settings.section slot, so the entry is one click away instead of hiding behind the Plugins page's package list:

Field Meaning
Enable routing proxy (switch) Off by default: off = the plugin does nothing at all — no local listener, no host-policy takeover, no list refreshing; everything follows your existing environment (no exported proxy means all direct). On = route by the rules
Upstream proxy e.g. http://192.168.3.47:12801; empty falls back to https_proxy / http_proxy from the launch environment
Route when nothing matches direct (recommended) or proxy
List refresh period hours; 0 keeps whatever cache exists
Local router bind address where the small local proxy the plugin starts is bound (you normally never touch this): the host points all outbound traffic at it, and it decides direct vs. upstream per rule. Loopback only (e.g. 127.0.0.1:17890); if the port is taken it falls back to a random one; port 0 = let the OS choose
Connect timeout milliseconds; applies to connection setup only, never to streaming responses
Fall back to direct when the upstream fails retry directly when the proxied connection cannot be established
Log every routing decision verbose per-request lines on the host's stderr

The section reads top-down: the master switch → the live status panel (bind address, upstream and where it came from, whether the host policy was taken over and whether bash subprocesses are routed, rule counts, hit statistics, the local rules file path, and each remote list's size and refresh time) → the settings form → the local-rules editor.

Worth knowing:

  • The switch takes effect on the flip (one atomic write through the settings namespace, bypassing drafts): switching off closes the listener, uninstalls the host policy and restores the process's proxy variables to their previous values; switching on loads the rules, binds the listener and takes the policy over again. No dsh restart either way.
  • The text fields in the form save when you press Save. They are volatile, so the host writes new values straight into the running instance and emits loader/volatile-update — upstream, default route, timeout, fallback and debug are read per request, and changing the bind address re-binds the listener and repoints the host policy at it. While the switch is off, saving only persists the values; they take effect when you switch it on.
  • Settings are written to the profile's user layer (the row's config: in ~/.dsh/profiles//cordis.patch.yml), over the composition layer and the schema defaults. Each field has a "reset" action that removes the user-layer entry, falling back to the composition default.
  • A field counts as overridden purely by its presence in the user layer; concurrent writes are fenced by revision instead of silently overwriting each other.
  • Loopback-only bind addresses are a deliberate safety limit: the plugin's local proxy is unauthenticated, so binding 0.0.0.0 or a LAN address would publish an open forward proxy to your network. The form rejects it, and the host side has a second guard (a non-loopback value is rewritten to 127.0.0.1 with a warning).
  • lists (remote blocklist URLs) and stateDir / rulesFile are not volatile, so they never appear in the settings form — they are deployment facts, and blocklist URLs live in the profile's composition config. The contents of the local rules file, however, are editable right in the settings page (below).
  • With the switch off there is no local listener, so the curl 127.0.0.1:17890/__proxy-router/status debugging endpoint is gone too (the settings panel still works — it reads the host's same-origin read-only route).

Local routing rules (edited right in the settings page)

The "本地分流规则" block at the bottom of the section edits ~/.dsh/proxy-router/rules.txt:

# one rule per line; '#' starts a comment; first match wins, top-down
proxy: some-blocked-site.com     # this domain and all subdomains → via the upstream
direct: cdn.example.cn           # this domain and all subdomains → always direct
example.com                      # a bare domain is the same as proxy:
1.2.3.4                          # IP literals work too
  • Also accepted: *.example.com, .example.com, +.example.com, DOMAIN-SUFFIX,example.com, DOMAIN,example.com, DOMAIN-KEYWORD,ads, plus dnsmasq's server=/example.com/114.114.114.114; IDN domains are punycoded before matching.
  • Local rules win over everything: if a remote blocklist over-matches a domestic site, one direct: line corrects it.
  • "保存规则" writes the file and reloads it immediately (no dsh restart, and no need to press the form's Save above); the previous content is copied to rules.txt.bak first, and the replacement is a temp-file + rename so nothing ever reads a half-written file.
  • Parsing is deliberately lenient: lines it cannot understand are skipped and listed with line numbers in the editor (a silently ignored typo is worse than refusing to save).
  • Two write gates, for the record: routes registered by the host skip session auth, so writes accept PUT only and must be same-origin (Origin/Referer matching Host), with a 256 KB body cap.
  • With the master switch off, saving only writes the file; it takes effect once you switch the plugin on.

> ⚠️ Once the upstream is configured here, stop exporting http_proxy / https_proxy / all_proxy in your launch command.
> The host freezes those values into a snapshot at boot and hands it to bash subprocesses, which take priority —
> so curl/git/npm would bypass the router and talk to your exported upstream directly. The plugin detects this,
> warns loudly in the log, and marks bash subprocesses as "direct to upstream (bypassing the router)" in the status panel.

Composition config (deployment defaults)

Saving the section writes the profile's user layer; the profile's composition config (the row's config: in cordis.patch.yml) is the deployment default and resolves above the schema defaults. Put machine-wide defaults there:

# ~/.dsh/profiles/web/cordis.patch.yml
- id: proxy-router
config:
upstream: http://192.168.3.47:12801
debug: false

Two path-shaped fields stay composition-only (they are deployment facts, not preferences):

Field Default Meaning
stateDir ~/.dsh/proxy-router cache and default rules file location
rulesFile /rules.txt local rules file path

Every editable field may also be written here as a default; lists accepts plain URL strings or { name, url, route } objects (the plugin flattens them to a URL list).

The local rules file (the CLI / headless equivalent)

The file lives at ~/.dsh/proxy-router/rules.txt; a commented template is created on first run.
Editing the file takes effect immediately too (the plugin watches it) — no dsh restart. The settings
page's editor writes exactly this file, so the two paths share one rule set and never fight:

  • Settings page: handy for adding one line and seeing the diagnostics right there (unparsable lines are listed with line numbers).
  • Editor / scripts: vi ~/.dsh/proxy-router/rules.txt — better for bulk pastes and keeping the file in your dotfiles.

Syntax, precedence and save behaviour are documented under
Local routing rules above.

Debugging

The local router ships a loopback-only debug endpoint:

# overview: bind address, upstream, rule counts, hit stats, policy self-check
curl -s http://127.0.0.1:17890/__proxy-router/status

# ask how a host would be routed
curl -s "http://127.0.0.1:17890/__proxy-router/why?host=www.google.com"
# → {"host":"www.google.com","route":"proxy","reason":"list:gfw:google.com"}

# reload rules (local + remote)
curl -s http://127.0.0.1:17890/__proxy-router/reload

The settings section reads the same status snapshot through the host web server's same-origin read-only route GET /dsh-proxy-router/status; its rules editor goes through GET/PUT /dsh-proxy-router/rules (PUT must be same-origin, body capped at 256 KB, and the previous file is backed up to rules.txt.bak and replaced atomically).

You can also verify routing with curl directly:

curl -x http://127.0.0.1:17890 -sI https://www.google.com   # via upstream
curl -x http://127.0.0.1:17890 -sI https://www.baidu.com    # direct

The startup log prints the upstream and its source, the bind address, rule counts, the policy self-check result, the configuration-page entry point, and whether bash subprocesses are routed too.

Robustness

  • No self-recursion: a request whose target is this proxy's own listen address is never forwarded (plain HTTP gets 421, /favicon.ico gets 204, / gets a human-readable hint). Without that guard, something as harmless as opening http://127.0.0.1:17890/... in a browser snowballs into a self-loop — 0.1.0 produced over a hundred million requests that way, so 0.1.1 rejects them outright.
  • An upstream pointing at itself is ignored: when the upstream equals this plugin's own listen address it is treated as "no upstream", with an explicit warning in the log and in the status panel, instead of CONNECTing back into itself.
  • Rate-limited warnings: one line per distinct failure every 5 seconds, with a suppressed-count summary, so no failure mode can flood your terminal.

Compatibility

  • Verified against dsh 0.1.7-rc.2 since 0.3.0, and against dsh 0.2.0-rc.1 since 0.3.1.
  • Why 0.3.1 exists — dsh 0.2.0-rc.1 checks every declared @deepseek-ai/dsh-* peer range against the runtime version and skips any plugin whose ranges do not match (^0.1.7-rc.2 excludes 0.2.0-rc.1). No plugin code changed: 0.3.1 only widens those ranges to ^0.1.7-rc.2 || ^0.2.0-rc.1. On 0.2.0-rc.1 an already-installed 0.3.0 can also be admitted without upgrading, by granting the exact-version exemption (dsh plugin --profile allow-version @yangzhe1991/dsh-proxy-router@0.3.0 --dsh-version 0.2.0-rc.1 --accept-risk).
  • dsh < 0.1.7 is not supported: 0.1.7 replaced plugin configuration (settings.yaml + ctx.settings.installSection + the client's settingsScope / settings.plugin.item) with a row-level Config schema and volatile live updates; this plugin implements the new contract.
  • The host half depends only on the public exports of @deepseek-ai/dsh-http-proxy, @deepseek-ai/schemastery and undici, plus cordis' ctx.get / ctx.effect / ctx.inject; the browser half requires only platform module-table entries (react, react/jsx-runtime, @deepseek-ai/dsh-client-ui-primitives) and declares no non-baseline module request.
  • The configuration UI uses the official settings system (a Config schema + the settings page's settings.section slot + the shared ctx.configForms form). The section does not appear at all unless the host is running this row (configForms.whileServed gates it), and the plugin exits quietly on a deployment without a settings provider — everything else keeps working.

Known limits

  • HTTP proxies only (http:// / https://). all_proxy=socks5://… is ignored with a warning; if your proxy also exposes a mixed port (mihomo/clash mixed-port), point the upstream at http://host:port.
  • No TLS interception: https is routed by the CONNECT hostname only, so URL-path rules are impossible by design.
  • Rules support domain suffixes, exact domains, keywords and IP literals — no regular expressions.
  • The local router binds loopback only and is never exposed to the LAN (a non-loopback listen value is rejected, with a second guard on the host side).
  • The rules editor edits the local rules file; remote blocklist URLs (lists) still live in the profile composition config, and the rule syntax itself has no regular expressions.

License

MIT

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
dsh-proxy-router 怎么安装?

在 DSH 里执行 `dsh plugin --profile web add @yangzhe1991/dsh-proxy-router` 即可。对应的 npm 包名是 `@yangzhe1991/dsh-proxy-router`。

dsh-proxy-router 的验证等级是什么意思?

L5 · 运行验证通过。在 dsh 沙盒中完成安装与运行冒烟——装得上、跑得起来

dsh-proxy-router 安全吗?

低风险。vet 静态分析未发现可疑行为,判定为干净(clean)。

dsh-proxy-router 装之前要先确认什么?

先看它会读写哪些文件、执行哪些命令、连接哪些网络地址;验证等级只说明装得上、跑得起来,不等于安全。涉及密钥或系统权限的,建议先在隔离环境试装。

dsh-proxy-router 支持哪些 DSH 版本?

上游记录的兼容版本包括 0.2.0-rc.2、0.1.7-rc.2、0.1.7-rc.1、0.1.6-alpha.2、0.1.6-alpha.1。

dsh-proxy-router 用的是什么许可证?

上游标注为 MIT。商用或二次分发前请到仓库确认许可证原文。

dsh-proxy-router 有哪些功能?

被墙域名走代理,其余直连、本地规则 + 远程订阅 + 内置种子、Web 设置页改上游,热生效、覆盖 fetch、web_fetch 与 bash 子进程、状态面板显示命中统计。

这条记录的数据可靠吗?

本站按仓库名去重后合并整理,字段以作者仓库与 npm 元数据为准;安装命令、仓库地址与 README 保持原文,带 L4 / L5 标记的安装命令已在隔离沙盒里真实跑通。

同名或近似条目

1 条
不同作者的仓库分开列,请确认你要装的是哪一个
浏览器与联网
按星标排序,可作替代方案

dsh-our-free-model

dsh-our-free-model

在 DeepSeek Harness 中装上这个 DSH plugin,无需登录、注册或填 API Key,即可直接调用 DeepSeek

L3 · 安装规范通过 8,796 星

dsh-web

dsh-web

侧边栏多列任务看板:卡片交给真实 DSH 智能体会话执行,支持 cron 定时(Host 侧到点执行,关浏览器也生效)。

L3 · 安装规范通过 8,549 星

BrowserSkill

BrowserSkill

BrowserSkill 的 DeepSeek Harness 浏览器自动化桥接插件,通过原生浏览器工具控制可见的 Chrome 和 Edg

L4 · 沙盒安装通过 8,456 星

dsh-pocket

dsh-pocket

DSH Pocket 让 DeepSeek Harness 装进口袋:电脑跑 dsh web,手机扫码即实时同步访问(局域网+公网),人在外

L5 · 运行验证通过 1,656 星

Browser4

Browser4

L4 · 沙盒安装通过 1,152 星

agentrq

agentrq

L4 · 沙盒安装通过 1,140 星

yangzhe1991 的其它插件

5 个

插件的元信息来自作者仓库;分类、验证等级与安全结论的中文说明为中文整理,最近核验 2026-10-08。