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

Function hasHttpProxy

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

* True when an HTTP/HTTPS-scheme proxy is configured — via `HTTP_PROXY`, * `HTTPS_PROXY`, or an http-scheme `ALL_PROXY` (the catch-all fallback).

(env: Env)

Source from the content-addressed store, hash-verified

56 * `HTTPS_PROXY`, or an http-scheme `ALL_PROXY` (the catch-all fallback).
57 */
58function hasHttpProxy(env: Env): boolean {
59 return [
60 firstNonBlank(env, ['http_proxy', 'HTTP_PROXY']),
61 firstNonBlank(env, ['https_proxy', 'HTTPS_PROXY']),
62 firstNonBlank(env, ['all_proxy', 'ALL_PROXY']),
63 ].some((value) => httpSchemeValue(value) !== undefined);
64}
65
66/**
67 * Resolve the effective http/https proxy URLs: the scheme-specific

Callers 3

isProxyConfiguredFunction · 0.85
createProxyDispatcherFunction · 0.85
proxyEnvForChildFunction · 0.85

Calls 2

firstNonBlankFunction · 0.85
httpSchemeValueFunction · 0.85

Tested by

no test coverage detected