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.
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 theip-regex
package for this, which simply contains a bunch of regular expressions that match IP addresses.