dsh-egress-router: DeepSeek Harness On-Demand Egress Routing Plugin

Preface

The DeepSeek Harness ecosystem emphasizes pluginization. When developing locally or running Agents, developers often encounter situations where github.com, pip, or specific domains cannot be connected to directly. Forcing all traffic through a proxy may hinder model calls or increase latency. dsh-egress-router aims to resolve this conflict: after importing node links, it routes only blocked traffic through the proxy, keeps the rest of the traffic on a direct connection, and supports automatic fallback.

Plugin Introduction

Maintained by gswenxue and licensed under MIT, this plugin utilizes the sing-box kernel to provide proxy capabilities. It runs locally with user privileges and listens on the 127.0.0.1 port.

Core Features

The plugin offers the following capabilities:

  1. Three Running Modes: Off (all direct), Smart (nodes for list-specified domains, direct for others, with automatic fallback on failure), Global (all traffic via node).
  2. Routing Based on Measured Speed:
    • Race: For domains in the list, direct connection and node start simultaneously; the first byte wins.
    • Decision Memory: Records the winner to reduce the overhead of repeated races.
    • Throughput Penalty: Samples traffic within 1.2 seconds after connection establishment; downgrades if rate-limited.
  3. Node Status Management: Nodes have statuses (Normal/Invalid/Local Unavailable) and are never automatically deleted; invalid status only changes state, deletion requires manual action.
  4. Protocol Support: Supports four link types: vless/vmess/trojan/ss.
  5. On-demand Kernel: Uses sing-box, automatically downloading and verifying SHA-256 when first needed.
  6. Environment Variable Injection: Does not modify Harness global egress policies; only injects environment variables such as http_proxy / https_proxy into child processes.

Installation and Activation

Add the plugin using the official installation command:

dsh plugin --profile web add github:gswenxue/dsh-egress-router

After installation, restart DSH Web or reopen the settings page to view the relevant configuration under Settings → Network Proxy.

Usage

Importing Nodes

  1. Go to Settings → Network Proxy.
  2. Paste one or more node links (supporting vless/vmess/trojan/ss).
  3. Click import; the note will be taken from the # fragment in the link.

Agent Tools and Terminal Integration

The plugin injects the net_proxy tool into the Agent, supporting the following commands:

  • status: View kernel and node status.
  • list: List nodes and their notes and statuses.
  • import / remove / use / mode / route / test / clean / fetch / core: Node management, mode switching, routing configuration, testing, and kernel operations.

Once Inject Agent shell environment is enabled, terminal commands such as curl, git, pip, and npm will automatically read the local proxy address (default http://127.0.0.1:30810) and route through the proxy based on smart policies, without the need to manually add the -x parameter.

Notes

  • Permissions and Ports: The plugin runs with user privileges and listens on ports on 127.0.0.1 (default 30810/30811/30812). If the port is occupied, you can modify the port configuration in state.json.
  • Data Security: Node information is stored locally in state.json; no telemetry is collected, and no services other than configuration are accessed.
  • web_fetch Limitation: The built-in web_fetch of the Harness does not use this plugin’s proxy. To fetch blocked sites, use net_proxy fetch or terminal commands.
  • No Auto-update: The plugin does not provide an automatic update feature; upgrading requires uninstalling and reinstalling.
  • IPv6 Limitation: On IPv4 machines, IPv6 single-stack nodes will be marked as “Local Unavailable” and will not be automatically deleted.
羽毛球分组比赛记分
小程序二维码

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

Xiaoye