TooTallNate / proxy-agents

Node.js HTTP Proxy Agents Monorepo
https://proxy-agents.n8.io
872 stars 229 forks source link

Support dynamic headers for `https-proxy-agent` #174

Closed jportner closed 1 year ago

jportner commented 1 year ago

Currently, the headers option can only be passed in when the HttpsProxyAgent is first created, so consumers can only set headers statically.

Typically, proxy headers are used to trace requests as they pass through multiple systems to enable log correlation. If someone wants to reuse a single HttpsProxyAgent for multiple requests, this isn't ideal.

This PR updates the headers option so that it can also be a function that returns an object, allowing consumers to set the proxy headers dynamically.

Companion PR to update HttpProxyAgent: #175

changeset-bot[bot] commented 1 year ago

🦋 Changeset detected

Latest commit: 5d7701d49acdcf17da514df31921d83e173daf45

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ----------------- | ----- | | https-proxy-agent | Minor |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
proxy-agents ✅ Ready (Inspect) Visit Preview May 17, 2023 3:51pm