MCPcopy
hub / github.com/codeaashu/claude-code / getAWSClientProxyConfig

Function getAWSClientProxyConfig

src/utils/proxy.ts:394–418  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

392 * Returns configuration object that can be spread into AWS service client constructors
393 */
394export async function getAWSClientProxyConfig(): Promise<object> {
395 const proxyUrl = getProxyUrl()
396
397 if (!proxyUrl) {
398 return {}
399 }
400
401 const [{ NodeHttpHandler }, { defaultProvider }] = await Promise.all([
402 import('@smithy/node-http-handler'),
403 import('@aws-sdk/credential-provider-node'),
404 ])
405
406 const agent = createHttpsProxyAgent(proxyUrl)
407 const requestHandler = new NodeHttpHandler({
408 httpAgent: agent,
409 httpsAgent: agent,
410 })
411
412 return {
413 requestHandler,
414 credentials: defaultProvider({
415 clientConfig: { requestHandler },
416 }),
417 }
418}
419
420/**
421 * Clear proxy agent cache.

Callers 2

createBedrockClientFunction · 0.85

Calls 2

getProxyUrlFunction · 0.85
createHttpsProxyAgentFunction · 0.85

Tested by

no test coverage detected