Preface¶
One of the core design principles of DeepSeek Harness (DSH) is “everything is a plugin.” During development or debugging, switching outbound proxies (e.g., from HTTP to SOCKS, or changing proxy addresses) typically requires restarting the application or modifying configuration files. The dsh-proxy-control plugin provides the ability to dynamically control outbound proxies at runtime without requiring a restart.
Core Features¶
The plugin primarily addresses the following issues:
- Choose from three sources: Supports three modes—built-in (startup environment), system (Windows proxy settings), and manual (custom address).
- Immediate effect: After modifying the proxy address, direct connection list, or switching sources, the next request will use the new configuration.
- Factual reporting: The interface displays the actual traffic path currently in effect, not just the plugin’s configuration state.
- Coverage: Supports outbound traffic for fetch, web_fetch, and subprocesses.
- Traffic control: Forces direct connection for loopback addresses; supports traffic splitting via the direct connection list.
- Connectivity self-test: Provides a self-test feature that validates whether the configuration is effective along the actual call path.
Installation and Activation¶
Before installing, ensure your environment meets the requirements: DSH 0.2 series and Node.js 22+.
Use the official installation command:
dsh plugin --profile desktop add "/absolute/path/dsh-proxy-control"
A restart is required after installation because the bundle list is only read at startup. The cordis.patch.yml within the plugin package will automatically insert into the profile. If you want to modify the configuration directly, you can edit the profile’s cordis.patch.yml:
- id: proxy-control
name: dsh-proxy-control
config:
mode: env # env built-in / system system / manual manual
proxy: '' # only used in manual mode
noProxy: '' # direct connection list
testUrl: '' # leave empty to use default self-test address
The
enabledandautoDetectfields from earlier versions have been removed; if these fields remain in the configuration file, they will be cleared on the next save.
Usage¶
Operate in the Settings → Proxy page.
The interface is divided into three rows, each corresponding to one of the three sources (manual/system/built-in). Unselected ones will be grayed out and marked as “Not selected.”
- Reload: Click the icon button to reload the built-in source or system proxy settings.
- Re-detect: For system proxy, re-detect the settings in the Windows registry.
- Test: Click the icon button to make a request to the self-test address to verify the connectivity of the current configuration.
- Manual mode: Directly enter the proxy address and direct connection list; save on blur or by pressing Enter.
- View results: Below each row, the “Active Proxy” and “Self-test Result” will be displayed.
Configuration Options¶
| Configuration Item | Description |
|---|---|
| Proxy Source | Choose one of Built-in / System / Manual. Defaults to Built-in, lazy-loaded, does not change any behavior. |
| Proxy Address | Only used in manual mode, e.g., http://127.0.0.1:7890. Only accepts http and https protocols. |
| Direct Connection List | Hostnames that bypass the proxy. Only for manual/system modes; built-in mode uses the environment variable NO_PROXY. |
| Self-test Address | The address accessed by the “Test” function; if left empty, uses the default address. |
Three Sources¶
| Interface Name | Data Source | Description |
|---|---|---|
| Manual | User input | Manually specify the proxy address and direct connection list. |
| System | Windows registry | Only available in the desktop version. Reads Internet Settings, does not parse PAC. |
| Built-in | $DSH_HOME/.env or startup variables |
The plugin does not interfere with routing; only reads startup environment configuration. |
The built-in mode is lazy; after installation, it does not change any behavior by default. If “Active Proxy” shows “Startup environment (.env or exported variables),” it means the traffic goes through the DSH launcher layer.
Known Limitations¶
- Protocol limitations: SOCKS is not supported; only
http/httpsare accepted. - Platform limitations: System proxy is only available in the desktop version; this option is disabled on the web version and PAC is not parsed.
- Wildcard limitations: The system bypass list is entirely ignored, and wildcards (e.g.,
127.*) are not supported. - CIDR limitations: The direct connection list does not support CIDR format (e.g.,
10.0.0.0/8). - Categorization limitations: No per-category switching; LLM conversations and web searches share the same URL.
- Pre-startup limitations: Custom CA needs to set
NODE_EXTRA_CA_CERTSbefore startup. - Process isolation: Electron’s own traffic (auto-update, login page) is not controlled by the plugin.
- Subprocess policy: Subprocesses follow the policy; if a proxy is also configured in
.env, the subprocess will prioritize the.envvalue.
Security¶
Since the settings page API can change traffic routing, the plugin has implemented security restrictions on API requests:
- Only accepts local requests (otherwise returns 403).
- Requires Host to be a loopback address (blocks DNS rebinding attacks).
- Rejects request body formats that can be sent cross-site without preflight (returns 415).
- DSH’s web server itself does not have authentication or origin policies; third-party routes must implement their own defenses.
Troubleshooting¶
If the proxy is not taking effect, please check the “Active Proxy” row; this is the authoritative reading.
Check the subprocess environment variables (only published after policy installation):
$env:HTTPS_PROXY; $env:NODE_USE_ENV_PROXY
The logs typically show similar information:
proxy-control: outbound request via http://127.0.0.1:7890 (manually specified), direct connection list api.deepseek.com
proxy-control: does not interfere with routing (no proxy settings in startup environment, treated as direct connection)
proxy-control: unable to use <address> (<reason>), outbound request remains direct
License¶
MIT License