Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add https_proxy and http_proxy to the proxy configs #294

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions lib/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,14 @@ export function getVSCodeDownloadUrl(version: Version, platform: string) {
let PROXY_AGENT: HttpProxyAgent<string> | undefined = undefined;
let HTTPS_PROXY_AGENT: HttpsProxyAgent<string> | 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 {
Expand Down
Loading