dsh-proxy-control: HTTP Proxy Control Before Startup and at Runtime

Introduction

When developing with network access in DeepSeek Harness (dsh), outbound HTTP traffic often needs to pass through a local or corporate proxy. DSH parses outbound proxies once at startup—before the first plugin is mounted—from the inherited environment or $DSH_HOME/.env. Model catalog discovery, plugin installation, login, and update checks can all occur during this phase. A proxy plugin that only modifies the undici dispatcher at runtime does not cover the launcher phase, meaning the first request may still fail by attempting a direct connection.

Below is an introduction to the community plugin dsh-proxy-control (maintainer Bai-Ziyi). It writes the proxy configuration to the same user-level .env file read by the launcher and applies it immediately to the current process via DSH’s public interface. It keeps the $DSH_HOME/.env in sync via toggles on the plugin page. The plugin is categorized as a networking tool. Source code and documentation can be found on GitHub, and the community directory page is at skillhub.cn.

What is this

dsh-proxy-control is a pre-startup and runtime HTTP proxy control plugin for DSH. It solves two problems: ensuring the launcher phase uses the proxy on the next startup, and allowing model requests, web scraping, and MCP HTTP requests within the current process to switch strategies without restarting after saving the configuration. Configuration is done via toggles and fields in Plugins → Installed → Proxy Control → Config. It is persisted in the profile’s cordis.patch.yml and synced to $DSH_HOME/.env.

Core Features

  • Provides toggles and fields such as url and noProxy on the plugin configuration page (see next section).
  • Atomically rewrites $DSH_HOME/.env: removes old proxy lines and appends HTTP_PROXY / HTTPS_PROXY (and optional NO_PROXY), preserving the order of unrelated lines.
  • Calls installProxyFromEnvironment from @deepseek-ai/dsh-http-proxy to replace the process-wide undici global dispatcher, taking effect immediately at runtime.
  • When the toggle is turned off, removes proxy lines and installs a direct connection strategy; the next startup will also use a direct connection.
  • Local loopback addresses are always connected directly; only http:// and https:// proxy addresses are accepted.
  • When url is empty, it remains silent: it does not rewrite .env, does not touch the dispatcher, and will not overwrite proxies you have manually written in .env after installation.

The plugin does not support SOCKS, PAC, or system proxy detection. It does not perform traffic splitting by vendor (you can use NO_PROXY to allow direct connections for specific hosts). It does not store credentials; the proxy address is written to .env as-is. It is not recommended to enable this simultaneously with other proxy plugins that replace the undici global dispatcher.

Installation and Activation

DSH community plugins are installed via profiles; the GitHub username is Bai-Ziyi (capital B, capital Z). After installation, you must restart DSH once to load the new bundle, then fill in the proxy address on the configuration page and turn on the toggle.

Desktop Profile:

dsh plugin --profile desktop add github:Bai-Ziyi/dsh-proxy-control

Web Profile:

dsh plugin --profile web add github:Bai-Ziyi/dsh-proxy-control

Configuration

Field Default Meaning
enabled false Whether outbound requests should go through the proxy.
url Empty HTTP or HTTPS proxy address, e.g., http://127.0.0.1:8080.
noProxy Empty Optional comma-separated list of hosts to bypass the proxy.

After saving the address and turning on enabled, the configuration is written to the profile and synced to $DSH_HOME/.env; the current process applies it immediately via installProxyFromEnvironment. Turning off the toggle at runtime does not rewrite the environment of already spawned child processes; if child processes also need direct connection or proxy access, DSH needs to be restarted.

How it Works (Brief)

  1. The host side reads enabled, url, and noProxy; if url is empty, it returns immediately.
  2. Atomically updates proxy-related lines in $DSH_HOME/.env.
  3. Calls installProxyFromEnvironment to install the override strategy.
  4. On uninstall or configuration change, it first restores the previous dispatcher and then installs the new strategy.

Therefore, the file is written before the next startup, covering the launcher phase as well—something a purely runtime plugin cannot reach.

Use Cases and Notes

Suitable for: Unified control of HTTP outbound traffic during the startup phase and runtime phase in DSH 0.2.x; using HTTP/HTTPS ports provided by local proxy clients; managing proxies via the plugin page toggle while keeping consistency with $DSH_HOME/.env.

Notes:

  • Compatibility is subject to the README: Tested on DSH 0.2.1-rc.2 with a local HTTP proxy. It depends on @deepseek-ai/dsh-http-proxy, @deepseek-ai/dsh-home-paths, and @deepseek-ai/schemastery. The versions match the declarations built into DSH. When upgrading DSH, these three dependency versions in the plugin need to be upgraded accordingly.
  • The plugin runs with the permissions of the current dsh process and will write to .env in the user directory; please review the source code and the MIT License before installation.
  • The DeepSeek Harness ecosystem emphasizes “Everything is a plugin”; the directory on skillhub.cn is a community site and has no official affiliation with DeepSeek / High-Flyer.

Conclusion

dsh-proxy-control writes the HTTP proxy into $DSH_HOME/.env and syncs it at runtime, bridging the gap that “runtime-only proxies” cannot cover the launcher phase. If you are already using DSH for agent development that requires stable network access, you can install it using the command above and enable it after filling in the http(s):// address on the Proxy Control configuration page.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye