dsh-auto-proxy: Automatic Local HTTP Proxy for DSH

Introduction

When performing network fetching, calling HTTP MCP, or routing requests through the global dispatcher in DeepSeek Harness (DSH), outbound traffic often relies on local proxies like Clash or system proxies already running on the machine. Common practices involve manually modifying environment variables, enabling TUN or global mode, or reconfiguring DSH every time the proxy port changes. These methods involve multiple steps and easily conflict with DSH’s built-in NO_PROXY and local bypass strategies.

The following introduces the community plugin dsh-auto-proxy (Maintainer: murenyu1, Category: Networking Tool). It provides a toggle within DSH to automatically discover local HTTP/Mixed proxy ports and connects the running DSH to that proxy via a fixed loopback entry. When turned off or uninstalled, it restores the proxy strategy to its pre-activation state. The design references the concept of “fixed local proxy entry, dynamic upstream switching” from SuiSuiNian721’s codex-connection-monitor, adapted for DSH’s plugin lifecycle and native proxy APIs.

What is this

dsh-auto-proxy (npm package name dsh-plugin-auto-proxy) is aimed at developers who are already running proxy software locally and want DSH outbound traffic to use the same HTTP/Mixed port. The plugin does not start proxy software, nor does it select nodes based on proxy rules; it only detects available ports, verifies connectivity, and connects DSH to a fixed entry on 127.0.0.1. When the upstream port changes, only the entry’s upstream is modified, eliminating the need to open TUN or a dedicated launcher for DSH.

The documentation specifies: The current README corresponds to version 1.0.5, verified against host DeepSeek Harness 0.2.1-rc.2, with Node 22.21+. Real-host network acceptance testing was completed on Windows, where it successfully auto-identified Mixed port 7897 from Clash Verge configuration. Software that only provides SOCKS or VPN and lacks an HTTP/Mixed proxy port cannot be directly integrated.

Core Features

Automatic Discovery and Validation

The discovery sequence is roughly as follows: It prioritizes reading the current mixed-port / port from Clash Verge configuration, followed by reading the enabled Windows system proxy for the current user and Clash kernel listening ports. It does not blindly scan common ports, nor does it treat SOCKS or kernel control APIs as HTTP proxies.

Each candidate must pass HTTP CONNECT, TLS certificate verification, and a GitHub HTTPS response check. If NO_PROXY contains * or GitHub, the plugin will raise an error prompt rather than falsely reporting that the proxy has been connected.

Fixed Entry and DSH Integration

The DSH connection only listens to a fixed HTTP proxy entry on 127.0.0.1. When the upstream address changes, new requests route through the new upstream, while established connections may still follow the old upstream. If the proxy is unavailable, new requests are rejected; there is no automatic fallback to direct connection. Explicit NO_PROXY settings remain effective as configured.

The plugin calls the host’s installProxyFromEnvironment to install the running policy and verifies the page fetching route via proxyRouteFor. Documentation records: Native web_fetch and standard Node fetch have been tested. Model requests and HTTP MCP sharing the same path as the DSH global dispatcher are affected by the policy, but paid models or user MCPs have not undergone acceptance testing.

Multi-Entry and State Synchronization

Starting from version 1.0.5, operations are supported in multiple locations including the right sidebar, bottom workbench, environment capsule at the bottom of the dialog, and plugin management configuration cards. Internally, state is synchronized via the ProxyStateHub global singleton bus. If dsh-better-sidebar is installed, you can access it from the “Auto Proxy” tab on the right; if not installed, the native sidebar tab is still available. A compact status capsule can be displayed below the conversation input box, allowing toggling of start/stop with a click.

Security and Boundaries

The entry listens only locally, limits concurrency, and rejects browser requests containing an Origin header; the plugin’s own entry will not become an upstream (self-loop protection). It does not modify settings.json, system proxy, Clash configuration, or certificate policies; it does not decrypt HTTPS or log request bodies.

If proxy environment variables already exist when DSH starts, the host API may retain them for child processes. The plugin will issue a prompt, but it cannot guarantee that git, gh, or child process MCPs will strictly switch to this plugin’s entry. Already running child processes, independent browsers, workflow workers, and PTC will not be forcibly taken over.

Installation and Enablement

It is recommended to install via the DSH Plugin Management page using “Local Installation Package” and selecting dsh-plugin-auto-proxy-1.0.5.tgz (The actual path for Release attachments or source code build artifacts under downloads/ depends on your local environment).

For CLI management, execute the following in the directory containing the installation package (replace web with your actual profile):

dsh plugin --profile web add ./dsh-plugin-auto-proxy-1.0.5.tgz --ignore-scripts

For the official desktop version, profiles are managed by the application; prioritize in-app installation. The installation command is only for registering the plugin; toggling and proxy switching do not require restarting DSH (Whether the host needs to reload is determined by the DSH manager).

Typical Usage

  1. Start your local proxy software and DSH normally.
  2. Enable “Auto Proxy” in the right sidebar, bottom workbench, bottom capsule, or plugin configuration card, and save.
  3. After the status synchronizes to “Connected,” the interface topology can display the DSH Entry ➔ Local Proxy ➔ External Network link.
  4. If automatic discovery does not meet expectations, manually fill in the address (e.g., http://127.0.0.1:7897) in the settings; it takes effect immediately upon saving.

Turning off “Enable Auto Proxy” and saving will restore DSH’s proxy strategy to the state before the plugin was enabled; uninstalling will clean up the entry and restore the strategy.

Suitable Scenarios and Notes

Suitable for: Developers on Windows using Clash Verge or similar tools to provide a local HTTP/Mixed port, who want DSH’s web_fetch, Node fetch, etc., to remain consistent with the desktop proxy, but do not wish to enable TUN/Global mode.

Notes:

  • The plugin runs with the permissions of the current DSH process; before installation, you should review the source code and MIT license yourself to confirm you accept its scope of behavior.
  • If the rules within the proxy software reject a specific site, the plugin cannot bypass this.
  • If auxiliary discovery (Registry, PowerShell, Config files) fails, existing candidates are retained and a prompt is shown; if there are no valid candidates, it will not falsely report as connected.
  • The community directory SkillHub Plugin Page and GitHub repository are maintained by the community and have no official affiliation with DeepSeek/High-Flyer; the DSH ecosystem emphasizes “Everything is a Plugin,” and the facts in this article are based on the repository README and release notes.

Conclusion

dsh-auto-proxy strings together “Discover Local HTTP Proxy -> Fixed Loopback Entry -> DSH Native Proxy API” into a switchable link, accompanied by GitHub HTTPS detection and restoration upon closing. It is suitable for reducing the repetitive labor of manually configuring environment variables when a local proxy is already running.

  • Directory Page: https://www.skillhub.cn/plugins/murenyu1/dsh-auto-proxy
  • Source Code & Documentation: https://github.com/murenyu1/dsh-auto-proxy
羽毛球分组比赛记分
小程序二维码

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

Xiaoye