MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / resolveHttpProxyUrls

Function resolveHttpProxyUrls

packages/agent-core/src/utils/proxy.ts:72–78  ·  view source on GitHub ↗

* Resolve the effective http/https proxy URLs: the scheme-specific * `HTTP_PROXY`/`HTTPS_PROXY` (ignoring a SOCKS-scheme value), falling back to an * http-scheme `ALL_PROXY` catch-all. `undefined` for a scheme with no usable * value.

(env: Env)

Source from the content-addressed store, hash-verified

70 * value.
71 */
72function resolveHttpProxyUrls(env: Env): { httpProxy?: string; httpsProxy?: string } {
73 const allProxy = httpSchemeValue(firstNonBlank(env, ['all_proxy', 'ALL_PROXY']));
74 return {
75 httpProxy: httpSchemeValue(firstNonBlank(env, ['http_proxy', 'HTTP_PROXY'])) ?? allProxy,
76 httpsProxy: httpSchemeValue(firstNonBlank(env, ['https_proxy', 'HTTPS_PROXY'])) ?? allProxy,
77 };
78}
79
80/**
81 * Resolve a SOCKS proxy from the environment, or `undefined` if none. A SOCKS

Callers 2

createProxyDispatcherFunction · 0.85
proxyEnvForChildFunction · 0.85

Calls 2

httpSchemeValueFunction · 0.85
firstNonBlankFunction · 0.85

Tested by

no test coverage detected