dstp
dstp copied to clipboard
Support IPv6 URLs
Currently, it looks like the IPv6 bracketed IP syntax is not supported.
For example, testing IPv6 access to an HTTP server on port 8000 of IPv6 (example) address 2001:0db8:abcd:ef:a0a:a0a:a0a:3
$ dstp 'http://[2001:0db8:abcd:ef:a0a:a0a:a0a:3]:8000/'
Ping: 33.855667ms
DNS: resolving 2001:0db8:abcd:ef:a0a:a0a:a0a:3
SystemDNS: resolving 2001:0db8:abcd:ef:a0a:a0a:a0a:3
TLS: dial tcp: address 2001:0db8:abcd:ef:a0a:a0a:a0a:3:443: too many colons in address
HTTPS: Get "https://2001:0db8:abcd:ef:a0a:a0a:a0a:3": dial tcp: lookup 2001:0db8:abcd:ef:a0a:a0a:a0a:3: no such host
It looks like the required square brackets [] surrounding the IPv6 address are eaten during parsing, then it tries to directly access 2001:0db8:abcd:ef:a0a:a0a:a0a:3:443 as if it's a hostname on HTTPS port 443 rather than port 8000 as intended. The error returned makes sense, as a hostname should not have that many colons, but an IPv6 address should as long as it's surrounded by square brackets: [2001:0db8:abcd:ef:a0a:a0a:a0a:3]