TooTallNate / proxy-agents

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

Pass `localAddress` for "request" and "connect" #166

Closed LiudasSmatavicius closed 1 year ago

changeset-bot[bot] commented 1 year ago

🦋 Changeset detected

Latest commit: 07a08e108d720343cabcb24fd6eea99ccca500b9

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

This PR includes changesets to release 1 package | Name | Type | | ----- | ----- | | proxy | 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 12, 2023 10:55am
LiudasSmatavicius commented 1 year ago

interface ProxyServer accepts localAddress as string or undefined

Use example

const server = createProxy(http.createServer());
server.localAddress = '8.8.8.8'

server.listen(3128)
TooTallNate commented 1 year ago

I see. An options object would be "cleaner", but ya this works.

Probably would make sense to refactor this module to use classes at some point anyways.

I'll merge this, thanks!