Introduction¶
This is a network proxy routing plugin for DeepSeek Harness (DSH), maintained by liqiaohuia. It addresses a specific technical pain point: when multiple accounts exist for the same model provider (such as Anthropic or NVIDIA NIM), those accounts may need different proxy strategies—for example, a free-quota account goes through a proxy while a paid primary account connects directly—yet they all target the same API domain. Traditional domain-based routing cannot distinguish accounts. This plugin identifies the API key carried in each request, intercepts it at the Fetch layer, and implements precise account-level routing.
Core Capabilities¶
The plugin provides the following features:
- Provider (account) based routing: Based on the LLM accounts configured in DSH, assign a proxy or direct connection for each account.
- Named proxy pools: Supports SOCKS5, HTTP, and HTTPS protocols, with authentication (for example,
socks5://user:pass@host:port). - Graphical management: All configuration is completed on the DSH settings page, with hot-reload support.
- Direct-connection mode control: Defaults to “Absolute Direct” (since v0.5.0), forcibly bypassing the DSH global proxy; can also be switched to “Follow Global Proxy”.
- Built-in web tool proxying: Since v0.5.0, supports routing unclaimed traffic such as DSH’s built-in
web_fetchand MCP subprocesses through a proxy. - Fetch-layer interception: Intervenes at DSH’s
globalThis.fetchlevel without affecting other plugins.
Installation and Enablement¶
Before installing, make sure DSH is installed with version 0.1.3 or later, and that a proxy client (such as Clash or v2ray) is running.
- Install the plugin
Open a terminal and run the following command:
dsh plugin add dsh-proxy-routes
*Note: Command-line users (`dsh web`) may need to specify a profile. See the DSH documentation.*
-
Enable and open settings
After installation, completely exit DSH (for Desktop, fully quit from the tray) and restart it. After startup, open Settings → Proxy Routes.Entry points:
* Settings → Proxy Routes (general entry)
* DSH Desktop 2.0.14+: Sidebar “Plugins” page → dsh-proxy-routes → Details
Configuration and Usage¶
1. Configure proxy pools¶
In the proxy pool section of the settings page, give each proxy a name and enter its address. For example:
main=socks5://127.0.0.1:50939backup=http://user:pass@127.0.0.1:7890
Supported protocols include socks5, http, and https. For mixed ports (the same port accepting both HTTP and SOCKS), specify the actual protocol when using them.
2. Configure provider-based routing¶
In the “Provider-based routing” list, the options are automatically derived from the accounts configured on the DSH “Models” page (for example, claude1 and nvidia-01).
Each row can be set to:
* Direct
* A name from the proxy pool
* Rule: Do not set separately; use the default route.
3. Set default route and direct behavior¶
- Default route: The path used by accounts that are not explicitly configured or non-LLM traffic. It is recommended to default to
direct. - Direct behavior (default since v0.5.0):
- Absolute Direct: This plugin forces direct requests to be sent directly, ignoring system environment variables such as
HTTP(S)_PROXYand DSH global proxy settings. - Follow Global Proxy: Direct requests are left untouched and are handed back to DSH’s native outbound policy.
- Absolute Direct: This plugin forces direct requests to be sent directly, ignoring system environment variables such as
4. Built-in web tool proxying (v0.5.0)¶
Enable this option to route unclaimed traffic such as web_fetch requests and MCP subprocesses through a proxy.
* Configuration: Only http:// proxies are supported. The address format is host:port (for example, 127.0.0.1:10000).
* Effect: Takes effect immediately after saving; no DSH restart is required. It is automatically restored when the plugin is disabled or uninstalled.
5. Save configuration¶
Click Save to apply the configuration immediately.
Verify Effectiveness¶
After sending a message, look in the logs for entries with the [proxy-routes] prefix. The format is as follows:
[proxy-routes] POST api.anthropic.com/v1/messages -> claude1=>main:socks5://127.0.0.1:50939
Log paths:
* DSH Desktop (Windows): %APPDATA%\DSH Desktop\logs\host\dsh-<date>.log
* dsh web: The running console window
Note: Logs record only the destination and never contain API keys.
Technical Details and Compatibility¶
- How it works: The plugin extracts the
x-api-keyorauthorizationheader carried in DSH requests, matches it against mappings in memory, and thereby identifies the account. - Version requirement: DSH >= 0.1.3.
- File mode: In addition to graphical management, configuration can also be done manually by creating a
$DSH_HOME/proxy-routes.jsoncfile (JSONC syntax, hot-reload).
Notes¶
- Key security: API keys are only matched in memory; they are not written to logs or sent externally.
- Client startup: This plugin is not responsible for starting proxy clients such as Clash or v2ray; it only routes traffic.
- Windows reinstall: Before reinstalling or upgrading the plugin on Windows, you must completely exit DSH; otherwise, file lock errors may occur.
- Direct connection test: The default probe address
https://www.gstatic.com/generate_204may be blocked when accessed directly in mainland China. It is recommended to change it tohttps://www.baidu.comunder “Other Options” in DSH settings.
Conclusion¶
dsh-proxy-routes is a practical tool in the DSH ecosystem for handling multi-account proxy routing. Its graphical management reduces configuration complexity while providing flexible routing policies. For more details and source code, visit the GitHub repository.