Skip to content

Commit 498c3b8

Browse files
committed
Include specific npm proxy config, to ensure it works reliably
On my machine, node 10 + npm 6.4.1 seems to work fine, but using some older node or npm version combinations skips the proxy entirely, or sometimes has issues due to Request sending bad CONNECT requests in concert with global-agent. This fixes that, by ensuring npm 100% understands what's going on.
1 parent f300a55 commit 498c3b8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/interceptors/fresh-terminal.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,9 @@ export class TerminalInterceptor implements Interceptor {
255255
'GLOBAL_AGENT_HTTP_PROXY': `http://localhost:${proxyPort}`,
256256
// Used by some CGI engines to avoid 'httpoxy' vulnerability
257257
'CGI_HTTP_PROXY': `http://localhost:${proxyPort}`,
258+
// Used by npm, for versions that don't support HTTP_PROXY etc
259+
'npm_config_proxy': `http://localhost:${proxyPort}`,
260+
'npm_config_https_proxy': `http://localhost:${proxyPort}`,
258261

259262
// Trust cert when using OpenSSL with default settings
260263
'SSL_CERT_FILE': this.config.https.certPath,

0 commit comments

Comments
 (0)