DeepSeekDSH
Independent community guideNot affiliated with DeepSeek.Official source snapshot

Run DSH Behind an HTTP/HTTPS Proxy

Use this only when your network requires a proxy. First prove the problem is network-related, then enable Node's environment-proxy support without accidentally proxying DSH's own localhost traffic.

On this page
Do not add a proxy if your network does not need one

This guide is for company networks, VMs, restricted environments or local setups where outbound API access must pass through an HTTP/HTTPS proxy. A normal home connection should usually use DSH without these variables.

First prove the failure is a network/proxy problem

If DSH reports fetch failed, ECONNREFUSED, ETIMEDOUT, ECONNRESET or a certificate error while curl/npm work only through a proxy, the model configuration may be fine and the Node process may simply not be using the proxy.

npm view @deepseek-ai/dsh version

If even this basic registry request fails in the same shell, fix general network access first. If npm works but the LLM request fails, continue with the Node proxy checks below.

STEP 1

Check the Node.js version

node --version

DSH itself currently accepts ^22.19.0 || >=24.0.0. However, the Node environment-proxy switch used in this workaround arrived later: real DSH reports confirm NODE_USE_ENV_PROXY=1 needs Node 22.21+ or a supporting 24.x release.

A version can satisfy DSH but still be too old for the proxy switch

Node 22.19 or 22.20 can meet the DSH engine range while NODE_USE_ENV_PROXY still does nothing. Upgrade Node before assuming the proxy variables are wrong.

STEP 2

Set HTTP_PROXY and HTTPS_PROXY

Use the proxy address supplied by your network administrator or local proxy application.

export HTTP_PROXY=http://proxy.example:8080 export HTTPS_PROXY=http://proxy.example:8080

For PowerShell, set the variables in the same terminal that will launch DSH:

$env:HTTP_PROXY="http://proxy.example:8080" $env:HTTPS_PROXY="http://proxy.example:8080"

Do not publish proxy credentials or embed a real username/password in screenshots.

STEP 3

Keep DSH's local loopback traffic out of the proxy

DSH Web uses local loopback services. Add 127.0.0.1, localhost and ::1 to NO_PROXY so requests to the local DSH server do not get sent to the company proxy.

NO_PROXY=127.0.0.1,localhost,::1
Use comma-separated entries

A recent upstream report found semicolon-separated Windows NO_PROXY values were not parsed as intended by undici, causing localhost traffic to go through the proxy and return 403. Prefer commas or whitespace.

STEP 4

Enable Node's environment proxy and launch DSH

macOS/Linux:

export NODE_USE_ENV_PROXY=1 export NO_PROXY=127.0.0.1,localhost,::1 npx @deepseek-ai/dsh web

PowerShell:

$env:NODE_USE_ENV_PROXY="1" $env:NO_PROXY="127.0.0.1,localhost,::1" npx @deepseek-ai/dsh web

Test a simple model request. If it now reaches the provider, you have isolated the failure to Node's outbound proxy handling rather than the DSH API key or model selection.

Corporate TLS inspection may require a CA certificate

Some company networks terminate and re-sign HTTPS traffic. If the proxy route is correct but Node reports certificate-chain errors, your organization may require its trusted CA certificate through Node's NODE_EXTRA_CA_CERTS.

NODE_EXTRA_CA_CERTS=/path/to/company-ca.crt
Use only a certificate supplied by an administrator you trust

Do not download random certificates to suppress TLS errors. A custom CA changes which HTTPS certificates the Node process will trust.

Windows-specific notes

  • Use $env:NAME="value" for the current PowerShell session while testing.
  • Persistent setx changes apply to new terminals, not the already-open shell.
  • Use comma-separated NO_PROXY values; do not rely on a semicolon list.
  • A local DSH port error such as EADDRINUSE or Windows reserved-port EACCES is a different problem from an outbound proxy failure.

Common proxy and network failures

curl/npm use the proxy but DSH still connects directly

Confirm a supporting Node version and set NODE_USE_ENV_PROXY=1 in the same shell before starting DSH.

DSH Web opens, but localhost API calls return 403 through the proxy

Check NO_PROXY. Include 127.0.0.1,localhost,::1 and use comma-separated entries.

NODE_USE_ENV_PROXY=1 appears to do nothing

Check Node. DSH may run on Node 22.19/22.20, but the environment-proxy switch requires a newer Node release.

Certificate chain / self-signed certificate error

Ask your administrator whether the network uses TLS inspection and whether Node should trust a company CA via NODE_EXTRA_CA_CERTS.

SOCKS proxy does not work

The environment-proxy path discussed here is for HTTP/HTTPS proxies. Do not assume a SOCKS URL is handled by the same mechanism.

NEXTStill failing after network access works?
Open troubleshooting →