benoitc / hackney

simple HTTP client in Erlang
Other
1.34k stars 427 forks source link

Cannot connect to IPv6 Addresses #745

Closed calltelemetry-jason closed 1 month ago

calltelemetry-jason commented 3 months ago

Similar to #554 but that issue was fixed back in 2019.

Erlang 26.2.3 Elixir 1.16.2 Hackney 1.20.1

Replicated in Mac Sonoma, and Debian Linux builds of the same versions above.

Any ideas?

iex(120)> :hackney.request("get", "2a01:4f8:c0c:1de8::2") ** (ArgumentError) errors were found at the given arguments:

iex(3)> :hackney.request("get", "02c2:b164:02fe:0000:0000:0000:4d38") ** (ArgumentError) errors were found at the given arguments:

benoitc commented 1 month ago

try ["2a01:4f8:c0c:1de8::2]

calltelemetry-jason commented 1 month ago

Yes, good call. This syntax works. Closing this out. Thanks!

iex(14)> :hackney.request("get", "[2a01:4f8:c0c:1de8::2]") {:ok, 200, [ {"Server", "nginx/1.18.0"}, {"Date", "Fri, 23 Aug 2024 22:04:51 GMT"}, {"Content-Type", "text/html"}, {"Content-Length", "612"}, {"Last-Modified", "Thu, 22 Jun 2017 20:41:21 GMT"}, {"Connection", "keep-alive"}, {"ETag", "\"594c2b71-264\""}, {"Accept-Ranges", "bytes"} ], #Reference<0.3004653342.3239313412.121386>}