From 05fbe739d0ed6c2875dc921833ce6a2b176553f5 Mon Sep 17 00:00:00 2001 From: noah costello <29776732+nmcostello@users.noreply.github.com> Date: Thu, 21 Nov 2024 13:06:16 -0500 Subject: [PATCH] add https_proxy and http_proxy to the proxy configs --- lib/util.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/util.ts b/lib/util.ts index a38d0212..8a27af07 100644 --- a/lib/util.ts +++ b/lib/util.ts @@ -79,12 +79,14 @@ export function getVSCodeDownloadUrl(version: Version, platform: string) { let PROXY_AGENT: HttpProxyAgent | undefined = undefined; let HTTPS_PROXY_AGENT: HttpsProxyAgent | undefined = undefined; -if (process.env.npm_config_proxy) { - PROXY_AGENT = new HttpProxyAgent(process.env.npm_config_proxy); - HTTPS_PROXY_AGENT = new HttpsProxyAgent(process.env.npm_config_proxy); +if (process.env.npm_config_proxy || process.env.http_proxy) { + const proxy = process.env.npm_config_proxy || process.env.http_proxy + PROXY_AGENT = new HttpProxyAgent(proxy); + HTTPS_PROXY_AGENT = new HttpsProxyAgent(proxy); } -if (process.env.npm_config_https_proxy) { - HTTPS_PROXY_AGENT = new HttpsProxyAgent(process.env.npm_config_https_proxy); +if (process.env.npm_config_https_proxy || process.env.https_proxy) { + const proxy = process.env.npm_config_https_proxy || process.env.https_proxy; + HTTPS_PROXY_AGENT = new HttpsProxyAgent(proxy); } export function urlToOptions(url: string): https.RequestOptions {