Introduction¶
The built-in proxy in DeepSeek Harness (DSH) is process-level: it reads HTTPS_PROXY once at startup, and all outbound requests go through it. In practice, however, you often need to “route only one provider through a proxy,” use “a different egress for each provider,” or even “require a direct connection for a specific provider to get low latency.” Environment variables alone can’t handle this — you need a dispatcher that can route by host.
wagalicn/dsh-provider-proxy installs a custom dispatcher inside the DSH process. It looks up the hostname of each request, swaps in a proxy if there’s a match, and falls back to a direct connection otherwise. The maintainer is wagalicn.
Installation & Activation¶
The plugin has been submitted to the dshbase plugin directory; you can also search for dsh-provider-proxy in the DSH plugin marketplace to install it (currently under review).
Install from npm (recommended):
dsh plugin add @wagalicn/dsh-provider-proxy
Install from GitHub:
dsh plugin add github:wagalicn/dsh-provider-proxy
Install from a packed tgz file:
dsh plugin add file:D:/path/to/wagalicn-dsh-provider-proxy-1.2.1.tgz
After installation, restart DSH once.
Configuration Entry Point¶
There is a single entry point: Settings → Provider Proxy. The page is list-based and contains three sections:
- ① Active proxy rules
- ② Quick add (detected providers)
- ③ Advanced options
Proxy Rules & Matching¶
The page automatically lists the model providers you’ve added under “Settings → Models.” The API endpoint is auto-populated and can be edited directly. Fill in a proxy on the right to add it to section ①; leave it empty to indicate a direct connection for that provider. After adding a new provider, click “Refresh” to re-detect.
③ Addresses outside the list default to direct connections. If you check “Follow system proxy for unlisted addresses” on the page, unlisted domains will go through the Windows system proxy (or HTTPS_PROXY/HTTP_PROXY).
Changes take effect immediately (~1-second polling), no restart needed.
You can also write YAML directly (the config key for this plugin in cordis.patch.yml):
providers:
- provider: openai
baseURL: https://api.openai.com/v1
proxy: http://127.0.0.1:7890
- provider: deepseek
baseURL: https://api.deepseek.com
proxy: "" # direct connection
biliMode: mirror # off | mirror | system
Wildcards¶
A * in baseURL matches a hostname segment (bedrock-runtime.*.amazonaws.com, *.api.aws both work). AWS Bedrock endpoints are composed from partition/region segments, so wildcards are the most convenient approach:
- provider: bedrock
baseURL: https://bedrock-runtime.*.amazonaws.com/anthropic
proxy: http://127.0.0.1:7890
Routing Rules¶
| Request host | Proxy configured in row | Result |
|---|---|---|
| Matched | Non-empty | Route through that proxy |
| Matched | Empty | Direct connection |
| Not matched | — | Direct connection (switches to system proxy if “Follow system proxy” is checked) |
Integration with billion-context (bili)¶
If you’re using bili as an LLM relay, configuring the proxy in this plugin alone is not sufficient: after DSH hands the request to bili, it’s bili’s own Node process that actually makes the outbound call, and this plugin only lives in the DSH process — it can’t intercept that hop.
So there’s a “billion-context (bili)” section at the bottom of the plugin page:
| Option | Behavior |
|---|---|
Mirror this page’s proxy (default mirror) |
Writes each row’s “endpoint + proxy” into bili’s providers.<url>.proxy, sharing a single config with bili |
Let bili use the system proxy (system) |
Writes upstreamProxyMode: "auto", letting bili discover system/environment proxies on its own |
Don’t touch bili’s config (off) |
Leaves bili completely untouched |
The target file is %USERPROFILE%\.config\billion-context\billion-context.json (overridable via biliConfigPath). The plugin only removes or modifies keys it wrote itself (tracked in providerProxyManaged); your hand-written entries and other fields are preserved as-is. Bili reads its config at startup, so a restart is needed after changes.
Bili’s upstream proxy priority: providers.<url>.proxy → BILI_UPSTREAM_PROXY → Web UI manual proxy → top-level proxy → HTTPS_PROXY/HTTP_PROXY → system proxy.
Three-Layer Interception¶
Outbound requests in DSH travel through three different paths, and the plugin hooks into all three:
| Layer | What it covers | Approach |
|---|---|---|
globalThis.fetch |
Most adapters (pi-ai, deepseek, etc.) | Replaces the global fetch; routes through proxy on match |
| undici dispatcher | Libraries using undici directly, Node built-in fetch | Swaps the global dispatcher |
node:https |
Clients that build signatures themselves, like AWS SDK / SigV4 (e.g., Bedrock) | Wraps https.request / https.get; uses CONNECT tunnel on match |
SOCKS5 is not supported (socks5:// will emit a warning and fall back to direct connection); the node:https tunnel only supports http:// proxies.
Troubleshooting¶
Logs are at ~/.dsh/provider-proxy.log:
apply v1.1.0 pid=4956 node=v24.21.0
routes (1)
host bedrock-runtime.us-east-1.amazonaws.com -> http://127.0.0.1:7890
node https.request api.deepseek.com/chat/completions -> http://127.0.0.1:7890
host/route/nodelines present → the request was intercepted; check whether it went through the proxy.- No lines at all → the request didn’t originate from the DSH process (typical case: it went through an external process like bili).
Limitations¶
- Only supports HTTP(S) forward proxies; SOCKS5 is not supported.
- Matching is by hostname only; path and model name are not considered.
- A DSH restart is required to install newly added interception layers.
Conclusion¶
wagalicn/dsh-provider-proxy uses three-layer interception to route DSH’s outbound requests by host, allowing each model provider to use a different proxy or a direct connection. It also provides an option to sync with billion-context, making it easy to keep configuration consistent in multi-hop scenarios.
For more details and source code, see the directory page and GitHub repository:
- Directory page: https://www.skillhub.cn/plugins/wagalicn/dsh-provider-proxy
- GitHub: https://github.com/wagalicn/dsh-provider-proxy