MCPcopy Create free account
hub / github.com/SplashtopInc/winstall / configureProxy

Function configureProxy

utils/proxyConfig.js:10–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8let proxyConfigured = false;
9
10export function configureProxy() {
11 if (proxyConfigured) return;
12
13 const proxyUrl = process.env.HTTP_PROXY || process.env.HTTPS_PROXY ||
14 process.env.http_proxy || process.env.https_proxy;
15
16 if (!proxyUrl) {
17 return;
18 }
19
20 // Use env-aware proxy resolution so runtime config can stay outside application code.
21 const envHttpProxyAgent = new EnvHttpProxyAgent();
22 setGlobalDispatcher(envHttpProxyAgent);
23
24 proxyConfigured = true;
25}
26
27// Configure eagerly in dev/test to keep local behavior close to production startup.
28if (process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test") {

Callers 2

proxyConfig.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected