MCPcopy Create free account
hub / github.com/Rfym21/Qwen2API / getOrCreateAgent

Function getOrCreateAgent

src/utils/proxy-helper.js:44–52  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

42 const secureEndpoint = options.protocol === 'https:';
43 const targetHostname = options.servername || options.hostname;
44 const connector = new SocksProxyAgent(proxyUrls.get(proxyAgent), { timeout: PROXY_CONNECT_TIMEOUT_MS });
45 socket = await connector.connect(new PassThrough(), {
46 ...proxyAgent.options,
47 ...options,
48 host: options.hostname,
49 port: Number(options.port || (secureEndpoint ? 443 : 80)),
50 secureEndpoint,
51 servername: isIP(targetHostname) ? undefined : targetHostname,
52 checkServerIdentity: (hostname, certificate) => checkServerIdentity(targetHostname, certificate),
53 ALPNProtocols: ['http/1.1']
54 });
55 if (secureEndpoint) {

Callers 1

getProxyAgentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected