Skip to main content
H

dsh-proxy-settings

huk-dsh/dsh-proxy-settings

Configures a process-wide HTTP proxy for DeepSeek Harness with system, custom and direct modes, plus a status page and a live connectivity probe. Its HTTP routes have no DSH access check, so a web page open in your browser could call them.

Install

dsh plugin --profile web add github:huk-dsh/dsh-proxy-settings

README

dsh-proxy-settings

A single-purpose network proxy settings plugin for DeepSeek Harness (DSH). It installs a process-wide HTTP proxy policy for AI calls, web traffic and child processes, and exposes a read-only status page with a live connectivity probe.

DeepSeek Harness 的网络代理设置插件。它安装进程级 HTTP 代理策略,覆盖 AI 请求、网页访问与子进程,并提供一个带连通性探测的只读状态页。

Features / 功能

ModeBehaviour
systemKeep the proxy policy inherited at DSH launch; no changes are installed.
customInstall the configured HTTP(S) proxy URL, optional credentials and bypass list.
directInstall a direct policy and remove proxy keys, without touching the OS proxy settings.
  • Proxy URL accepts http(s)://host:port and the shorthand host:port.
  • Username/password can be embedded in the URL or supplied separately; the password is stored as a secret and is never returned to the settings page.
  • Loopback addresses are always bypassed; noProxy adds extra bypass entries.
  • GET /network-proxy/status reports the installed policy, the environment-based proxy, the AI route and (with ?probe=1) a timed connection test against the configured target.
  • On DSH NEXT the optional persistEnv switch maintains a delimited block in $DSH_HOME/.env, so a restart can apply the proxy before plugins mount.

Install / 安装

dsh plugin add github:huk-dsh/dsh-proxy-settings

For a named profile:

dsh plugin --profile <profile> add github:huk-dsh/dsh-proxy-settings

In DSH Desktop use Settings → Plugins, search for dsh-proxy-settings and install from there.

Configuration / 配置

The plugin adds a network-proxy settings page. It can also be configured through the profile patch:

- id: network-proxy
  name: dsh-proxy-settings
  config:
    mode: custom
    proxyUrl: http://127.0.0.1:7890
    username: ''
    password: ''
    noProxy: localhost,127.0.0.1,::1,.local
    probeUrl: https://api.deepseek.com
    persistEnv: false

All config fields are volatile because the harness settings service only exposes volatile fields to its revisioned writer.

DSH NEXT and .env

DSH NEXT resolves a proxy in the Electron shell before any plugin mounts (system proxy plus $DSH_HOME/.env). This plugin therefore layers on top of that launch policy, and restores it when returning to system mode. On NEXT, enabling persistEnv writes the chosen proxy into a managed block in $DSH_HOME/.env that the plugin owns, so the next launch uses it before the Host and plugins start. The block is removed when the mode leaves custom or the switch is turned off; nothing else in the file is touched. The status page reports the runtime flavor, the proxy inherited at launch and the state of the .env block.

DSH NEXT 会在插件加载之前由 Electron shell 解析代理(系统代理 + $DSH_HOME/.env)。本插件在该启动策略之上叠加,切回 system 会恢复原策略。在 NEXT 上勾选 persistEnv 后,插件会把所选代理写入 $DSH_HOME/.env 中由它管理的区块,使下次启动在宿主和插件加载前就使用代理;关闭后该区块会被移除,文件中的其他内容不受影响。状态页会显示运行时、启动时继承的代理以及 .env 区块状态。

How it works / 实现说明

The plugin resolves @deepseek-ai/dsh-http-proxy and @deepseek-ai/schemastery from the running DSH installation rather than from the profile. This keeps the module state shared with the harness and with dsh-subprocess's child-environment overlay, so the installed policy is authoritative. No npm install or build step is needed; the source is plain ESM.

插件从当前运行的 DSH 安装中解析 @deepseek-ai/dsh-http-proxy 与 @deepseek-ai/schemastery,而不是把它们装进 profile。这样模块状态与宿主、dsh-subprocess 的子进程环境覆盖层保持一致,安装的策略才是生效的那一份。不需要额外 npm 安装或构建步骤,源码就是纯 ESM。

The loader entry id remains network-proxy because it is both the loader id and the settings namespace; renaming it would orphan already-saved settings.

Differences from dsh-network-proxy

This is an independent, single-purpose implementation. Compared with the existing dsh-network-proxy plugin:

  • Ships as plain ESM with no build step and no package dependencies.
  • Adds a dedicated read-only status route (/network-proxy/status) with a timed connectivity probe and route reporting.
  • Ships its own settings page and bilingual locale files instead of installing into a general settings row.
  • Works on both DSH Desktop and DSH NEXT, including NEXT's pre-plugin .env proxy switch.
  • Kept as a standalone repository so it can be reviewed and updated on its own.

Security note / 安全说明

Installing a plugin executes third-party code with your privileges. This plugin writes process-level proxy environment variables, which affects all outgoing requests of the DSH process. Review the source before installing. Proxy passwords are stored through the harness secret mechanism and are not echoed back to the browser page.

License

MIT

Related plugins