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:
- 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).
- 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.
- Node Status Management: Nodes have statuses (Normal/Invalid/Local Unavailable) and are never automatically deleted; invalid status only changes state, deletion requires manual action.
- Protocol Support: Supports four link types: vless/vmess/trojan/ss.
- On-demand Kernel: Uses sing-box, automatically downloading and verifying SHA-256 when first needed.
- Environment Variable Injection: Does not modify Harness global egress policies; only injects environment variables such as
http_proxy/https_proxyinto 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¶
- Go to Settings → Network Proxy.
- Paste one or more node links (supporting vless/vmess/trojan/ss).
- 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 instate.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_fetchof the Harness does not use this plugin’s proxy. To fetch blocked sites, usenet_proxy fetchor 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.