Update: As of December 28, 2022 and at least Curl version 7.68.0 one can simply use Curl like this, without the -g
flag, and it works fine:
curl -6 "http://[::1]:8080/"
Older answer below for reference.
Looking at the suggestions — and breakdown of common errors in this blog post — perhaps you should try this.
curl -g -6 "http://[::1]:8080/"
The -g
seems to be the magical key to get this working. As explained on the curl
man page:
This option switches off the "URL globbing parser". When you set this option, you can specify URLs that contain the letters {}[] without having them being interpreted by curl itself. Note that these letters are not normal legal URL contents but they should be encoded according to the URI standard.
And the -6
means to use IPv6 only:
If libcurl is capable of resolving an address to multiple IP versions (which it is if it is IPv6-capable), this option tells libcurl to resolve names to IPv6 addresses only.
But reading that functionality description, it seems like -6
is not really needed for a pure IPv6 address; only if one is using curl
on a hostname that has an IPv4 and IPv6 address connected to it so it would prefer the IPv6. Just something to note.