MCPcopy Create free account
hub / github.com/codeaashu/claude-code / agentFactory

Function agentFactory

src/utils/telemetry/instrumentation.ts:806–821  ·  view source on GitHub ↗
(_protocol: string)

Source from the content-addressed store, hash-verified

804 // Return an HttpAgentFactory function that creates our proxy agent
805 const caCerts = getCACertificates()
806 const agentFactory = (_protocol: string) => {
807 // Create and return the proxy agent with mTLS and CA cert config
808 const proxyAgent =
809 mtlsConfig || caCerts
810 ? new HttpsProxyAgent(proxyUrl, {
811 ...(mtlsConfig && {
812 cert: mtlsConfig.cert,
813 key: mtlsConfig.key,
814 passphrase: mtlsConfig.passphrase,
815 }),
816 ...(caCerts && { ca: caCerts }),
817 })
818 : new HttpsProxyAgent(proxyUrl)
819
820 return proxyAgent
821 }
822
823 config.httpAgentOptions = agentFactory
824 return config

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected