title: Fetch API not working with localhost/127.0.0.1
body: <p>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).</p>
  
  <p>I am trying to make a request with Fetch API, from the React app, as follows:</p>
  
  <pre><code>var bearer = 'Bearer ...'
  return fetch('http://localhost:8080/home', {
    headers: new Headers({
      'Authorization': bearer
    })
  })
  </code></pre>
  
  <p>In the console, from both Chrome and Firefox, I am getting:</p>
  
  <p><strong>TypeError: NetworkError when attempting to fetch resource</strong></p>
  
  <p>The same goes when I substitute <code>localhost</code> with <code>127.0.0.1</code>.</p>
  
  <p>Using the external IP of the EC2 instance, however, works (and triggers a CORS request - due to the 'Authorization' header - which is handled smoothly by the server).</p>
  
  <p>In the latter case, I can also see the server logging the incoming request for both OPTIONS and GET (in the former case, no logs are present for either method).</p>
  
  <p>I also tried CURL'ing from the EC2 machine to <code>localhost</code> and the request effectively goes through which leads me to think that with the Fetch API the request is not triggered at all.</p>
  
  <p>Any advice would be appreciated. If I am doing anything wrong please point me in the right direction.</p>