I have a create-react-app app running on localhost:3000
and a proxy server running on localhost:4000
that redirects some of my request to port 3000.
Requesting localhost:3000/
correctly returns index.html file,
Requesting localhost:4000/
returns connect ECONNREFUSED ::1:3000
with 502 code.
The exact same setup works properly on Ubuntu (returns index.html from localhost:4000) and Windows so I am sure proxy works fine.
Proxy is built using https://www.npmjs.com/package/http-proxy but i was unable to find any solution to this in documentation.
My question is: Does mac require changing some extra settings to allow this kind of traffic?
CodePudding user response:
One solution is to edit /etc/hosts
and remove ::1 localhost
mapping or change it to ::1 ip6-localhost
(default setting on ubuntu)