MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / readConfig

Function readConfig

src/utils/proxy-fetch.ts:41–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39let noProxyDispatcher: Dispatcher | null = null;
40
41function readConfig(): ProxyConfig {
42 if (cachedConfig) return cachedConfig;
43 const env = process.env;
44 const httpsProxy = env.HTTPS_PROXY || env.https_proxy || env.ALL_PROXY || env.all_proxy;
45 const httpProxy = env.HTTP_PROXY || env.http_proxy || env.ALL_PROXY || env.all_proxy;
46 const noProxyRaw = env.NO_PROXY || env.no_proxy || '';
47 const noProxy = noProxyRaw.split(',').map(s => s.trim().toLowerCase()).filter(Boolean);
48 cachedConfig = { httpsProxy, httpProxy, noProxy };
49 if (httpsProxy || httpProxy) {
50 logger.info('Proxy env detected', { httpsProxy: redact(httpsProxy), httpProxy: redact(httpProxy), noProxy });
51 }
52 return cachedConfig;
53}
54
55function redact(url: string | undefined): string | undefined {
56 if (!url) return url;

Callers 1

getDispatcherForUrlFunction · 0.85

Calls 2

redactFunction · 0.85
infoMethod · 0.80

Tested by

no test coverage detected