benoitc / hackney

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

Failing to access localhost on macOS #718

Open philippseith opened 1 year ago

philippseith commented 1 year ago

I am trying to build a simple reverse proxy with https://hexdocs.pm/reverse_proxy_plug and its https://github.com/edgurgel/httpoison http client plugin. When I forward requests to a (angular dev-). server, listening on localhost:4200, they finally reach :hackney.request/5 with the url "http://localhost:4200" which times out, I guess because localhost resolves on macOS to ::1 instead of 127.0.0.1 (which seems to be the resolution result in hackney). When the angular dev server is explicitly started with address 127.0.0.1, the request works.

used versions: OTP 25 Elixir 1.14.1 hackney 1.18.1

benoitc commented 3 months ago

should be fixed with #737