mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-27 04:47:03 -06:00
refactor(llm): inline proxy URL resolver (#129984)
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
committed by
GitHub
parent
f26c053605
commit
ccac43e3cd
@@ -12,16 +12,11 @@ interface NodeHttpProxyAgents {
|
||||
httpsAgent: HttpsAgent;
|
||||
}
|
||||
|
||||
/** Resolves the environment proxy URL that applies to a target URL. */
|
||||
function resolveHttpProxyUrlForTarget(targetUrl: string | URL): URL | undefined {
|
||||
return resolveEnvNodeProxyUrlForTarget(targetUrl);
|
||||
}
|
||||
|
||||
/** Builds fixed HTTP and HTTPS proxy agents for a target URL, when env proxy config applies. */
|
||||
export function createHttpProxyAgentsForTarget(
|
||||
targetUrl: string | URL,
|
||||
): NodeHttpProxyAgents | undefined {
|
||||
const proxyUrl = resolveHttpProxyUrlForTarget(targetUrl);
|
||||
const proxyUrl = resolveEnvNodeProxyUrlForTarget(targetUrl);
|
||||
if (!proxyUrl) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user