Introduction¶
When using DeepSeek Harness (DSH) for agent development or runtime, if the current network environment has a local proxy (such as Clash, V2Ray, etc.), but direct access to overseas websites is unreachable, manually configuring environment variables or restarting processes is inefficient. dsh-net-proxy-plugin is a local network proxy fallback plugin that automatically scans the system’s proxy configuration, probes connectivity, and connects an available proxy to the running DSH process when direct connections fail.
Plugin Overview¶
This plugin is maintained by minatoAI and is an open-source tool under the MIT License. It does not include a built-in proxy service; rather, it complements DSH’s network layer: it detects system proxies, scans local ports, and automatically enables a detected proxy when direct connections fail, ensuring that fetch requests and child processes (such as git and pnpm) have available network access.
Core Features¶
-
Automatic candidate proxy discovery
Scan by priority: config fileextraProxies-> environment variables (HTTPS_PROXY/HTTP_PROXY/ALL_PROXY) -> system proxy (Windows Registry, macOSscutil, Linuxgsettings) -> common local ports (7890, 10809, etc., supporting HTTP and SOCKS5). -
Connectivity probing
Conduct direct and per-candidate-proxy connectivity tests for probe targets (default Google 204 and GitHub). An HTTP status code < 500 is considered reachable. -
Automatic decision
Provides two activation modes:
-auto(default): Activates only when direct connections fail and an available proxy exists.
-always: Activates if an available proxy exists.
Probe results are rechecked every 5 minutes by default (can be disabled or adjusted in configuration); manually refresh via commands when the VPN disconnects or ports change. -
Activation scope
- In-process: Takes over all fetch requests (undici dispatcher), covering scenarios such as LLM calls and web_search.
- Child processes: SetsHTTPS_PROXY/HTTP_PROXY/NO_PROXYenvironment variables to ensure that child processes such as git and pnpm also use the proxy. -
WebFetchProvider compatibility
Provides a semantically consistentnet-proxyWebFetchProvider, allowing one-click switching with dsh’s built-inweb_fetch, and supports custom timeouts, response size limits, and redirect rules.
Installation and Enablement¶
The plugin is distributed as a bundle. The installation command is:
dsh plugin --profile web add github:minatoAI/dsh-net-proxy-plugin
After installation, restart the DSH process for the configuration to take effect:
dsh --profile web
Configuration and Usage¶
Override the net-proxy line in the profile’s cordis.patch.yml to customize the probe targets, timeout, proxy list, and activation strategy.
- id: net-proxy
config:
targets: [https://www.google.com/generate_204, https://github.com]
probeTimeoutMs: 5000
reprobeIntervalMs: 300000
bypassHosts: [localhost, 127.0.0.1, ::1, api.deepseek.com, "*.deepseek.com"]
extraProxies: [http://127.0.0.1:7890]
probePorts: [7890, 7897, 10809]
activation: auto
In the Web UI, you can manage the plugin status with the following commands:
- Enter /net-proxy to view the currently active proxy, its source, and direct reachability.
- Enter /net-proxy refresh to immediately rerun the probe and decision process.
If the web_fetch tool also needs to use the proxy, switch the fetchProvider:
- id: web
config:
searchProvider: deepseek-official
fetchProvider: net-proxy
Important Notes¶
- Fallback solution: The plugin does not force network takeover. When no proxy is available or direct connections are normal, DSH behaves exactly as if the plugin were not installed.
- Limited to the dsh process: The plugin only reads and affects network access for the current dsh process and its child processes. It does not modify Windows system proxy settings.
- Trust the proxy: The plugin uses proxy services on your system to forward traffic. Make sure you trust the local proxy.
Conclusion¶
dsh-net-proxy-plugin solves the pain point of switching between direct and proxy connections in DSH through automated proxy discovery and decision-making. Developers do not need manual intervention; when direct connections fail, locally available proxies are used automatically. For more details and source code, refer to the GitHub repository.