319
parsed = new URL(targetUrl);
320
} catch {
322
>
}
323
const scheme = parsed.protocol === 'http:'
324
? (env.HTTP_PROXY ?? env.http_proxy)
326
const proxy = scheme ?? env.ALL_PROXY ?? env.all_proxy;
327
if (!proxy) {
328
return undefined;
329
}
331
if (noProxy && isNoProxyHost(noProxy, parsed.hostname)) {
333
>
}
334
>
return proxy;
335
>
}
336
337
/** Whether `hostname` matches any entry in a `NO_PROXY` list. */
339
>
const host = hostname.toLowerCase();
340
>
return noProxy.split(',').some(raw => {
341
>
const entry = raw.trim().toLowerCase().replace(/^\./, '');
342
>
if (!entry) {
343
return false;
344
}
346
>
});
347
>
}
348
349
/**