TooTallNate / proxy-agents

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

Support IPv6 proxy URLs #140

Closed ronmrdechai closed 1 year ago

ronmrdechai commented 1 year ago

When proxying, the agent sends a CONNECT <host>:<port> message. IPv6 with a port suffix is ambiguous, so servers usually require the address to be bracketed (e.g. ::1:8080 vs [::1]:8080). This commit checks if the host the agent is proxying to is an unbracketed IPv6, and wraps it in brackets. I'm using the ip-regex package for this, which simply contains a bunch of regular expressions that match IP addresses.

TooTallNate commented 1 year ago

IPv6 proxy URLs should be supported now. See here.