MCPcopy Index your code
hub / github.com/nodejs/node / parseProxyConfigFromEnv

Function parseProxyConfigFromEnv

lib/internal/http.js:212–232  ·  view source on GitHub ↗
(env, protocol, keepAlive)

Source from the content-addressed store, hash-verified

210}
211
212function parseProxyConfigFromEnv(env, protocol, keepAlive) {
213 // We only support proxying for HTTP and HTTPS requests.
214 if (protocol !== 'http:' && protocol !== 'https:') {
215 return null;
216 }
217
218 const proxyUrl = parseProxyUrl(env, protocol);
219 if (proxyUrl === null) {
220 return null;
221 }
222
223 // Only http:// and https:// proxies are supported.
224 // Ignore instead of throw, in case other protocols are supposed to be
225 // handled by the user land.
226 if (!proxyUrl.startsWith('http://') && !proxyUrl.startsWith('https://')) {
227 return null;
228 }
229
230 const noProxyList = env.no_proxy || env.NO_PROXY;
231 return new ProxyConfig(proxyUrl, keepAlive, noProxyList);
232}
233
234/**
235 * @param {ProxyConfig} proxyConfig

Callers 1

AgentFunction · 0.85

Calls 1

parseProxyUrlFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…