Imports a proxy subscription, supervises a local mihomo core (proxy-provider plus a url-test group), and fetches direct-first with automatic proxy fallback and per-host routing memory; exposes one proxy_router tool (status, start, stop, test, fetch, routes, forget).
Install
# from a prebuilt release tarball
dsh plugin --profile web add "https://github.com/Lequait/dsh-proxy-router/releases/download/v0.2.1/dsh-proxy-router-0.2.1.tgz"
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:Lequait/dsh-proxy-router
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
Direct-first fetching with automatic proxy fallback for DeepSeek Harness. Import a subscription; targets that fail direct are retried through the proxy, and the route that worked is remembered per host.
It exists to stop the retry-the-mirror loop: fail once, switch route once, and go straight down the working path next time.
Why not just an environment proxy
DSH's built-in dsh-http-proxy offers exactly one route: it installs HTTP_PROXY/HTTPS_PROXY/ALL_PROXY as undici's global dispatcher at launch. Everything matching goes through the proxy; nothing is decided per host, nothing is retried, nothing can change at runtime, and when the proxy dies every request dies with it.
This plugin adds the missing layer: two routes + memory + health checks.
How it works
subscription URL --+--> mihomo core (supervised) --> local mixed port http://127.0.0.1:<mixedPort>
| proxy-provider: refreshes the subscription
| url-test group: picks the lowest-latency healthy node, fails over
v
smartFetch (this plugin)
1. consult per-host routing memory (30 min TTL by default)
2. try direct -> on failure retry through the proxy
3. remember which route worked for that host
^
+-- with zero healthy nodes, the direct path still works
Node selection and failover belong to the core; choosing direct vs proxy belongs to the plugin. Transports are plain node:http / node:https / node:tls with a CONNECT tunnel - no third-party dependencies.
Install
dsh plugin --profile <your-profile> add dsh-proxy-router
dsh plugin --profile <your-profile> add github:Lequait/dsh-proxy-router
Restart the harness; the proxy_router tool then appears in the session.
The subscription link is the only input
Nothing else is required. Two ways to hand it over:
1. Give it to the agent (zero config, recommended)
proxy_router { action: "start", subscriptionUrl: "https://your-subscription-url" }
The link is remembered at <DSH_HOME>/cache/proxy-router/subscription.txt, so later status / test / fetch calls need nothing.
2. Put it in the plugin config (for auto-start with the harness) - fill subscriptionUrl and set autoStart: true.
The core is found for you
On start it looks for mihomo in order: DSH_PROXY_CORE -> PATH -> common install dirs -> running core processes -> Windows uninstall registry. A running Clash Verge supplies verge-mihomo.exe this way, whatever drive it lives on. If nothing is found it downloads mihomo (falling back across mirrors) into <DSH_HOME>/cache/proxy-router/bin/. corePath and DSH_PROXY_CORE are optional advanced overrides, never requirements.
Configuration (all optional)
Edit the proxy-router entry's config in your profile's cordis.patch.yml:
- id: proxy-router
name: dsh-proxy-router
config:
subscriptionUrl: 'https://your-subscription-url'
corePath: '' # empty = auto-detect mihomo / verge-mihomo
autoStart: true
mixedPort: 19097
controllerPort: 19098
| Field | Default | Meaning |
|---|---|---|
subscriptionUrl |
'' |
Subscription link; Clash YAML and base64 node lists both supported |
corePath |
auto-detect -> auto-download | Usually leave empty; set it only to force a specific core binary |
autoStart |
false |
Start the core with the harness |
mixedPort / controllerPort |
19097 / 19098 | Local mixed port and controller port |
directTimeoutMs / proxyTimeoutMs |
8000 / 12000 | Timeout budget per route |
healthUrl |
cloudflare 204 | Node health-check target |
The proxy_router tool
Actions: status, start, stop, test, fetch (direct-first with force to ignore memory), routes, forget.
Test
npm test
test/selftest.mjs proves, over real transports and a real local core: a direct failure falls back to the proxy and succeeds; the second call takes the learned route directly; reachable hosts stay direct; the routing memory persists.
Limits
- The subscription's nodes may all be dead (blocked or offline). The plugin then reports
0 healthyand only the direct path is used - it never lets a dead proxy take the agent down. - The subscription URL is written into the generated core config at
<DSH_HOME>/cache/proxy-router/config.yaml, which holds credentials. Do not sync or commit that directory. - The plugin runs a third-party core process (mihomo). Installing a plugin runs third-party code with your permissions.
- The built-in
web_fetchis not hijacked: this plugin ships its own tool and local proxy port. Routing the built-in fetcher needs actx.webfetch provider, which is a separate step.
License
MIT
Links
More in this category
Tencent/WeKnora#dsh-weknora★ 37918
Four read-only tools over a WeKnora knowledge base: list knowledge bases, hybrid passage search, reassemble one document's chunks in order, and WeKnora's own cited RAG or ReAct-agent answer with a resumable session id.
DayuanJiang/next-ai-draw-io#dsh-plugin★ 37097
Draws draw.io diagrams in DeepSeek Harness through the next-ai-drawio MCP server: the link in the reply opens a live preview in the right sidebar, you can edit the diagram by hand, and each AI change is a version you can restore. Node.js 18+; npx downloads the MCP server on first use.
superdesigndev/treg★ 8650
Tool catalog for agents: search ~2,600 external endpoints (SEO and SERP, backlinks, social, people and company enrichment, ad libraries, scraping) by the task you want done, read each one's parameters and per-call price, then call it with the credential injected server-side. Ships the skill plus an MCP row that stays disabled until TREG_TOKEN is set.
T-Auto/dsh-ops★ 5964
Provides bash, PowerShell 7, and high-performance Rust tools for DSH on Windows to reduce token usage.
sixtysevenlf/dsh-blender-plugin★ 2216
Lets a DSH agent drive a local Blender over a direct TCP channel with 15 tools: viewport frames, custom-angle renders, Python execution, headless and job offload, transaction rollback, and a planning layer of 228 ops across 34 families.
helloHub1212/dsh-windows-mcp★ 2002
Bridges the CursorTouch/Windows-MCP desktop automation server into DSH through the official MCP client bridge, registering its screenshot, UI tree snapshot, mouse and keyboard input, clipboard, process and registry tools as mcp__windows__* tools for the model, and adds a windows_mcp_doctor diagnostic tool. Computer Use is off by default and is switched on from the plugin panel.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.