DSH Plugins Marketplace

DSH Plugins

Plugins

/

dsh-clash-proxy

e

dsh-clash-proxy

Manifest valid

智能分流 · 自包含 · 上手简单 —— DeepSeek Harness 规则分流代理插件(国内直连 / 国外走订阅节点),完全由 AI 生成。

UI (client)hasBundlePatch

dsh-clash-proxy

Smart routing · Self-contained · Easy to start — a self-contained, zero-config rule-splitting proxy plugin.

A self-contained rule-splitting proxy plugin for DeepSeek Harness (DSH). No external Clash/mihomo client: a built-in rule engine plus your subscription nodes give the Harness process tree smooth access to both domestic (direct) and international (proxied) networks — while the rest of your system is untouched.

Features

  • Self-contained, zero external dependencies — mostly pure JavaScript over node:net / node:tls / node:crypto; hysteria2 and vless reality go through a bundled Go native connector (see "Native connector" below)
  • Built-in rule engine — embedded domestic domain suffixes (~110K entries, 467KB gzipped) and domestic IP ranges (IPv4/IPv6), plus subscription rules and custom DOMAIN / DOMAIN-SUFFIX / DOMAIN-KEYWORD / IP-CIDR / REJECT rules
  • Subscription parsing — full Clash configs, bare node lists, base64 bodies, node groups
  • Node transports (international egress):
    • socks5 / http upstream proxies
    • ss (shadowsocks AEAD: aes-128-gcm / aes-256-gcm / chacha20-ietf-poly1305)
    • trojan (tcp / tls / ws)
    • vless (tcp / tls / ws)
    • vless reality (xtls-rprx-vision + reality-opts, via the native connector)
    • vmess (AEAD alterId=0, tcp / ws, AES-128-GCM)
    • hysteria2 (QUIC, via the native connector)
    • tuic (QUIC variant, not implemented)
  • One port, two protocols — HTTP CONNECT + SOCKS5 on a single loopback port
  • Harness-only scope:
    • Listens on 127.0.0.1, no system proxy, no TUN
    • DSH subprocesses (pwsh/terminal, jobs, workflows) inherit the proxy via env vars
    • DSH's own fetch (web search, LLM, MCP) is routed through a runtime dispatcher
    • Loopback always bypasses (NO_PROXY) — no proxy loops
  • Native Web GUI — Settings → Clash Proxy: status, enable/restart, subscription update, node list, per-node latency tests, group selection, live traffic
  • Node selectionurl-test (auto-fastest) / select (manual, persisted) / fallback
  • Auto subscription refresh — configurable interval in hours, 0 disables

Install

dsh plugin --profile web add dsh-clash-proxy
# or from a local path / git repo:
dsh plugin --profile web add <path/to/dsh-clash-proxy>

Restart DSH (dsh web), open Settings → Clash Proxy, and fill in your subscription URL. Nothing else is needed.

Configuration

The Clash Proxy settings card (or a profile patch overlay):

| Field | Default | Meaning | |---|---|---| | enabled | true | Master switch; nothing listens or is injected when false | | subscriptionUrl | empty | Clash subscription URL; CLASH_SUBSCRIPTION_URL env var also works | | fetchProxyUrl | empty | Optional upstream proxy for fetching the subscription itself | | autoUpdateHours | 24 | Subscription refresh interval in hours, 0 disables | | groupType | url-test | Auto group type: url-test / select / fallback | | latencyTestUrl | gstatic 204 | Node health-check / latency-test URL | | latencyTimeoutMs | 3000 | Per-node latency test timeout | | noProxy | loopback | Extra NO_PROXY entries (loopback is always forced) | | extraRules | [] | Extra rule lines, e.g. DOMAIN-SUFFIX,example.com,DIRECT | | excludeRules | [] | Subscription rules to drop (substring match) |

Data directory: $DSH_HOME/clash-proxy/ (subscription cache, selection state). Routing data ships inside the package (lib/core/data/*.json.gz) and works offline; rebuild it with npm run build:cn-data.

How it works

DSH process tree
 ├─ DSH's own fetch ──(runtime dispatcher)─┐
 ├─ pwsh / terminal / jobs ──(env vars)────┤
 └─ workflow / subagents ───(inherited)────┘
                                           ▼
                        rule proxy (127.0.0.1:random port)
                          ├─ domestic domains/IPs → direct (fast)
                          └─ foreign → subscription node (ss/trojan/vless/vmess/hysteria2/socks5/http)
Other system programs ── unaffected (no system proxy / TUN)
  • Every connection is decided per-target: direct / proxy / reject
  • The GUI talks to the manager through the DSH webserver's /clash-proxy/* JSON API
  • Disabling/uninstalling restores env vars and the fetch dispatcher — no leftovers
  • Per-process random ports; multiple DSH instances never collide

The plugin reuses these DSH capabilities (no reinvented wheels):

| DSH capability | How it is reused | |---|---| | timer service | Subscription auto-update + periodic full latency-test loop | | webServer service | Registers the /clash-proxy/* prefix route for the browser's JSON API | | Settings system (dsh-settings) | installSettingsSection mounts an editable settings card shared with the browser | | Client slots / locale / settingsScope | Mounts the management panel into Settings; registers EN/ZH dictionaries | | Runtime fetch dispatcher | Injects a dispatcher so DSH's own fetch (search/LLM/MCP) goes through the proxy | | Environment injection | Spawned subprocesses (pwsh/jobs/workflow) inherit HTTP(S)_PROXY |

Usage & verification

Usage example (run inside DSH):

curl -x http://127.0.0.1:<proxy-port> https://ipinfo.io   # see the foreign exit IP
curl https://www.baidu.com                                # domestic direct, instant

Verification status (layered):

  • Verified:
    • Rule engine / subscription parsing / SS AEAD (test/smoke.mjs)
    • vmess(ws), trojan(ws+tls), vless(ws) end-to-end (local xray oracle)
    • hysteria2 / vless-reality manually verified against real nodes (script not published to avoid leaking credentials)
    • Real splitting + socks5/ss nodes via curl (test/proxy-e2e.mjs)
  • To verify (recommended before publish):
    • Fresh-profile install smoke test (dsh plugin add then first boot)
    • npm pack --dry-run package completeness (confirm lib/native/connector.exe and cordis.patch.yml are included)
    • Multi-instance random ports never collide

Development & tests

npm install
npm run build:cn-data              # regenerate CN routing data (needs internet)
node test/smoke.mjs                # rule engine / subscription / SS AEAD unit tests
node test/vmess-e2e.mjs            # vmess(ws) end-to-end (local xray server)
node test/trojan-ws-echo.mjs       # trojan(ws+tls) end-to-end (local xray server)
node test/vless-ws-echo.mjs        # vless(ws) end-to-end (local xray server)
node test/proxy-e2e.mjs            # end-to-end: real splitting + socks5/ss nodes via curl

The E2E tests ship minimal socks5/ss protocol fixtures; the vmess/trojan/vless tests need .clash-test/xray/xray.exe (a local oracle server). Set TEST_UPSTREAM_PROXY=http://127.0.0.1:7890 to let the fixture path reach the international internet through any HTTP proxy (test-only convenience).

Native connector

hysteria2 (QUIC) and vless reality (uTLS fingerprint) cannot be implemented in pure JavaScript, so the plugin ships a self-compiled Go native connector lib/native/connector.exe (source in native/, rebuild with go build -o ../lib/native/connector.exe .). Node bridges to it over stdio. It only does "dial + bidirectional relay" for those two protocols; the rule engine, subscription parsing, and node selection stay on the pure-JS side, with no dependency on any external Clash/mihomo binary.

FAQ

  • "No subscription" — fill subscriptionUrl (or set CLASH_SUBSCRIPTION_URL) and click "Update subscription".
  • Subscription update fails — the subscription may itself need a proxy; set fetchProxyUrl.
  • Nodes won't connect — check the node type in the GUI; ss / trojan / vless / vmess / hysteria2 / socks5 / http are supported, tuic is not.
  • Verify splitting — inside DSH run curl -x http://127.0.0.1:<port> ipinfo.io to see your exit IP; Baidu should feel instant.
  • Coexists with existing Clash clients — fully independent, random ports.

Known limitations

| Limitation | Cause | Mitigation | |---|---|---| | hysteria2 / vless-reality depend on a bundled Go connector (Windows amd64 binary) | QUIC / uTLS fingerprinting cannot be implemented in pure JS | On other platforms/arches run go build -o ../lib/native/connector.exe . from native/ | | tuic not supported | Another QUIC variant, not implemented | Pick ss/trojan/vless/vmess/hysteria2/socks5/http nodes in the GUI | | Some nodes have unstable egress to google / wikipedia / x.com (observed timeouts) | Depends on the subscription node's exit route | Test each node in the GUI and switch to a more stable one | | Only affects the Harness process tree; no system proxy | By design (safety boundary) | Use a separate system tool if you need system-wide proxying | | Pure-JS transports have limited throughput at extreme concurrency | node:net / node:tls event-loop model | Domestic traffic is direct; use proxied egress on demand |

Changelog

  • 0.2.0 — pure-JS transports for ss / trojan / vless(tcp/tls/ws) / vmess / socks5 / http; added hysteria2 and vless-reality (bundled Go native connector); Web GUI (status/subscription update/node list/latency tests/selection/traffic); rule engine + CN routing data + subscription parsing.

License & compliance

MIT. This plugin provides technical capability only; ensure your proxy service and usage comply with local laws and regulations.

Compatibility

DSH 0.1.5-rc.2: errorDSH 0.1.6-alpha.1: errorDSH 0.1.5-rc.1: errorDSH 0.1.5-alpha.2: errorDSH 0.1.5-alpha.1: errorDSH 0.1.3-alpha.2: errorDSH 0.1.2-rc.1: errorDSH 0.1.2-alpha.5: errorDSH 0.1.2-alpha.4: errorDSH 0.1.2-alpha.3: errorDSH 0.1.2-alpha.2: error

Versions

Latest versionPublishedSize
0.2.0

Comments

Loading…

Similar plugins

dsh-plugin-newsboard

by c-ling

DeepSeek Harness 网页端的 AI 与科技快讯看板:内置 RSS/JSON 源驱动的可拖拽浮窗,支持双语翻译、关键词过滤和设置页。

Manifest valid

3

MIT

JavaScript

Aug 21, 2026

dsh plugin --profile web add dsh-plugin-newsboard

by cheng-nan01

一个给 DeepSeek Harness 用的插件:让 AI 能真的打开浏览器上网——打开网页、点按钮、填表单、翻页、看页面内容,就像人一样操作浏览器。

Manifest valid

0

MIT

TypeScript

Aug 14, 2026

dsh plugin --profile web add dsh-tool-playwright

by tuogusa

DeepSeek Harness 思维导图插件:AI 回答自动整理为可编辑 Markdown,支持导出文件和生成图片;核心逻辑已内置,单包发布。

Manifest valid

0

506/wk

JavaScript

Aug 21, 2026

dsh plugin --profile web add dsh-mindmap

by aiworkskills

一个DeepSeek Harness的公众号运营插件,选题 → 写稿 → 排版 → 配图 → 发布

Manifest valid

8

Apache-2.0

TypeScript

Sep 10, 2026

dsh plugin --profile web add @aiworkskills/aws-wechat-article

by tttwh

将DeepSeek Harness插件列表按来源分组展示——官方插件与自行安装插件,一目了然。

Tools & CapabilitiesDevelopment & InfrastructureManifest valid

3

81/wk

MIT

JavaScript

Aug 28, 2026

dsh plugin --profile web add dsh-plugin-diraud

by inmny

DeepSeek Harness 插件:处理DSH沟槽的权限管理(full acess下传入同级或者降级的请求会报错,导致ai大战权限管理)

Manifest valid

17

MIT

JavaScript

Aug 21, 2026

dsh plugin --profile web add dsh-plugin-sandbox-escalation-fix