I have a backend written in Go. Everything is working fine and the call from POSTMAN is being delivered, but suddenly I can't get the React app to call this server because I get the error:
Proxy error: Could not proxy request /login from localhost:3000 to http://localhost:8080 (ECONNREFUSED).
My Go server code:
log.Fatal(http.ListenAndServe(fmt.Sprintf("localhost:8080"), api.router))
The package.json for the React application looks like this:
"proxy": "http://localhost:8080"
I know I can bind all interfaces in Go like this:
log.Fatal(http.ListenAndServe(fmt.Sprintf(":8080"), api.router))
But Mac OS asks me to allow this connection, but I can't do it because I'm not the administrator of the computer
I could do this via co-design, but I don't have any identity at the moment, so generating the private key and adding it to the keychain would also take some time
Is there any easy way to bypass this?
Have you tried adding a slash at the end of the react agent line like this:
The above was found here
in questions similar to yoursAlso, you can try changing the proxy from localhost to 127.0.0.1: