Foreword¶
DeepSeek Harness (DSH) involves a large number of network requests in agent development, including model calls, web_search, web_fetch, and spawned tools. These requests need to be routed uniformly through a proxy server; otherwise, network failures or policy restrictions may occur.
Native proxy configurations often have blind spots, causing operations such as web_fetch to bypass the proxy. As a proxy manager plugin for DeepSeek Harness (DSH), dsh-proxy-pro uniformly routes runtime traffic (model requests, web_search, web_fetch) to the Windows system proxy or a custom address, and provides visual toggles and diagnostics.
Core Features¶
Unified Routing
Uniformly route all runtime network requests to the Windows system proxy or a custom address.
One-click Toggle in Conversation Header
A capsule button is provided on the right side of each conversation header: green indicates the proxy is on, and red indicates it is off. Click it to toggle the global switch. An “off → on” action triggers a manual recheck, restores the system registry, and reapplies the proxy configuration.
Settings Page “Proxy Configuration”
Provides a visual configuration interface that displays runtime facts (effective address, reason, direct-connection list), rather than only displaying inferred settings.
Mode: supports only “System Proxy (Windows)” and “Custom Address”.
* Custom Address: supports http://host:port or a bare host:port format.
* Direct-connection list (NO_PROXY)*: the currently effective list is shown below the editor. In system mode, the Windows system ProxyOverride is automatically merged in.
Toolchain
Provides four command-line tools for diagnostics:
* proxy_status: query the current status.
* proxy_set: turn the entire runtime on/off with one click.
* proxy_test: single-URL routing diagnosis (determines PROXIED / DIRECT, probes connectivity, and indicates NTLM authentication failures).
* proxy_config: read/modify configuration.
Installation and Enabling¶
Install using DSH’s plugin manager; choose either method.
Method A: npm Installation (Recommended)
dsh plugin --profile web add @yanglaofish/dsh-proxy-pro
dsh plugin --profile test add @yanglaofish/dsh-proxy-pro
Method B: GitHub Source Installation
dsh plugin --profile web add github:yanglaofish/dsh-proxy-pro
After installation, launch directly:
dsh web
Typical Usage¶
Conversation Header Toggle
Click the capsule button in the conversation header and check its color state to confirm whether the proxy is active.
Settings Page Configuration
1、Enter the settings page and select “Proxy Configuration”.
2、In “Proxy Address Source”, choose “System Proxy (Windows)” or “Custom Address”.
3、If “Custom Address” is selected, enter the proxy server address.
4、Edit the “Direct-connection list (NO_PROXY)” to exclude specific domains.
5、Use the “Routing Diagnosis” function, enter a URL, and check “Use proxy” or leave it unchecked to perform dual-channel probing, then determine whether the domain should go through the proxy or connect directly.
Model-side Usage
In the conversation, invoke tools such as proxy_status, proxy_set, proxy_test, and proxy_config; the model returns status based on the latest registry facts.
Configuration¶
The plugin supports zero-migration configuration in settings.yaml:
proxy:
enabled: false
mode: system # system | custom(none 仅解析旧配置残留)
customUrl: http://127.0.0.1:7890
noProxy: localhost,127.0.0.1,::1
systemPollMs: 30000
Technical Details¶
Single Transport Channel
The plugin incorporates installProxyFromEnvironment() into the policy channel of @deepseek-ai/dsh-http-proxy, unifying management of env, dispatcher, and policies. This eliminates dual-instance inconsistency issues (such as UND_ERR_INVALID_ARG) and resolves network failures in web_fetch.
Idempotent Kernel
The plugin uses effKey as the idempotent kernel and reinstalls the dispatcher only when the effective state actually changes. This fixes the root cause of the legacy behavior where reinstalling on every fetch caused desktop lag. Read-only APIs and polling never trigger an unconditional reinstall.
Browser Trust Fence
The panel API implements a trust fence consistent with the official DSH /api (Host loopback + sec-fetch-site + Origin validation), ensuring the security of browser-side requests.
Clean Uninstallation
During uninstallation, the plugin restores the original env, dispatcher, and policies, and fire-and-forget drains the background keep-alive connections, leaving no residue.
Uninstall¶
dsh plugin --profile web remove @yanglaofish/dsh-proxy-pro
dsh plugin --profile test remove @yanglaofish/dsh-proxy-pro
Uninstallation restores the original routing behavior.
Notes¶
- System limitation: Currently, only the Windows system proxy or a custom address is supported.
- License: The plugin uses the MIT license.
- Development: The plugin uses native ESM, has no build step, and its pure logic layer
lib/proxy-core.jshas zero DSH dependencies, allowing independent unit testing.