In DeepSeek Harness (DSH) usage scenarios, model API requests are often mixed with other requests such as web searches and MCP calls. If a global environment-variable proxy is used, all requests go through the proxy, which can slow down non-model requests; if connected directly, model requests may fail due to network restrictions. The elizax/dsh-http-proxy plugin solves this problem. Without modifying the official DSH code, it enables fine-grained control: model requests go through a proxy while other requests connect directly.
Core Features¶
The plugin mainly provides the following capabilities:
- Domain-based routing: Automatically identifies model API domains and sends them through a proxy, while other DSH requests (such as web search and MCP) remain direct.
- Non-invasive: Does not modify any official DSH code; after uninstallation, the original state is fully restored with no residual configuration.
- Protocol support: Supports
http/https/socks4/socks4a/socks5/socks5hprotocols. - Automatic detection: When
proxyHostsis left empty, the plugin automatically proxies default model domains (such asapi.deepseek.com, the domain pointed to byDEEPSEEK_BASE_URL, etc.). - Flexible domain configuration: Supports plain domains,
domain:port, full URLs, as well as.domain(matches subdomains) and*.domain(wildcard). - Hot configuration: After changing the configuration in the settings UI, the change takes effect on the next request without restarting DSH.
Installation¶
Before installing, make sure the DSH version is ≥ 0.1.2-alpha.2.
dsh plugin --profile web add dsh-http-proxy@0.1.3
In the command above, web is the profile name. Replace it with the profile you are actually using (for example, headless). After installation, restart DSH to activate it:
dsh --profile web
Configuration¶
There are two configuration methods with the same effect. If both are set, the UI (settings page) configuration takes precedence.
Method 1: Web UI (Recommended)¶
Open DSH Settings → Plugin Configuration and find the HTTP Proxy card. Enter the proxy address and save; the configuration takes effect on the next request. The card provides options for “Proxy only these domains” and “Exclude domains,” allowing precise control over the proxy scope.
Method 2: Environment Variable (Temporary)¶
Suitable for temporary testing without modifying configuration files.
$env:DSH_HTTP_PROXY = 'socks5://127.0.0.1:7890'
The environment variable only provides the proxy address and is equivalent to the “proxy address” field in the UI; domain filtering still uses automatic detection by default.
Configuration Field Description¶
| Field | Description |
|---|---|
proxy |
Proxy URL. Supports http/https/socks protocols. If left empty, the plugin does not take effect |
proxyHosts |
Proxy only these domains. Empty = automatically proxy all model domains; filled in = proxy only the listed domains |
excludeHosts |
Excluded domains: highest priority. Even if automatically detected or listed in proxyHosts, they are excluded |
The domain field supports the following formats: plain domains, domain:port, full URLs, or .domain / *.domain suffixes.
Relationship with DSH Built-in Proxy¶
DSH 0.1.3+ has a built-in environment-variable proxy (HTTP_PROXY / HTTPS_PROXY / ALL_PROXY / NO_PROXY), whose behavior is that all outbound requests follow the setting.
This plugin is the opposite: by default, only model domains go through the proxy. The relationship is as follows:
- Only want model requests to use a proxy: Use this plugin.
- Want all requests (including model requests) to use a proxy: Use the built-in environment-variable proxy in DSH 0.1.3+.
- Both are enabled: Model requests use this plugin’s proxy, while other requests use DSH’s environment-variable proxy.
Limitations and Notes¶
- Domain routing logic: The plugin distinguishes between “model requests” and “other requests” by domain. If a domain hosts both model services and other purposes (for example,
chatgpt.com,api.cloudflare.com), those requests will also be proxied. - WebSocket streaming: Streaming with
transport: websocketdoes not go throughfetch; it remains a direct connection and does not use this plugin’s proxy. - Private channel requests: Requests sent through vendor-native SDK private channels, such as
amazon-bedrock, do not go throughfetch; this plugin cannot proxy them. Such requests must rely on the built-in environment-variable proxy in DSH 0.1.3+. - Proxy authentication: Only credentials embedded in the proxy URL are supported (for example,
http://user:pass@host:port). DSH stores and displays the URL as-is and does not provide a separate authentication configuration field.
Ecosystem Background¶
The design philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” elizax/dsh-http-proxy is a model inference plugin contributed by a community developer to the DSH ecosystem. This directory is maintained by a third party and has no affiliation with official DeepSeek or High-Flyer.