Skip to content

Commit 58bbf25

Browse files
committed
proxy_agent.ts: Document why there is no $HTTPS_PROXY support
1 parent a021bf5 commit 58bbf25

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/node/proxy_agent.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,16 @@ import * as proxyagent from "proxy-agent"
1919
* custom agent from the proxyAgent package.
2020
*/
2121
export function monkeyPatch(vscode: boolean): void {
22-
if (!process.env.HTTP_PROXY) {
22+
// We do not support HTTPS_PROXY here to avoid confusion. proxy-agent will automatically
23+
// use the correct protocol to connect to the proxy depending on the requested URL.
24+
//
25+
// We could implement support ourselves to allow people to configure the proxy used for
26+
// HTTPS vs HTTP but there doesn't seem to be much value in that.
27+
//
28+
// At least of right now, it'd just be plain confusing to support HTTPS_PROXY when proxy-agent
29+
// will still use HTTP to hit it for HTTP requests.
30+
const proxyURL = process.env.HTTP_PROXY || process.env.http_proxy
31+
if (!proxyURL) {
2332
return
2433
}
2534

0 commit comments

Comments
 (0)