Fetch API not working with localhost/127.0.0.1
问题 Just as background, I have a react app sitting on a remote EC2 Ubuntu instance. The same server also runs a Go app listening on port 8080 (port has been opened to everyone from the Security settings). I am trying to make a request with Fetch API, from the React app, as follows: var bearer = 'Bearer ...' return fetch('http://localhost:8080/home', { headers: new Headers({ 'Authorization': bearer }) }) In the console, from both Chrome and Firefox, I am getting: TypeError: NetworkError when