title: Flutter: Connecting to localhost:5001 with http package from local device doesn't work
body: <p>I have the following problem: I have a .NET API running on my local machine at https://localhost:5001. When I execute a request in Postman, it works totally fine, but when executing the same API call in Dart, it won't work.</p>
  <p>In Postman https://localhost:5001 will respond with a 401 or a 200 Statuscode.</p>
  <p>When I execute the exact same URL in Flutter, it will give me a timeout:
  <a href="https://i.stack.imgur.com/UQp7w.png" rel="nofollow noreferrer">Flutter Devtools</a></p>
  <p>When using https://localhost:5001 in Flutter -&gt; SocketException: OS Error: Connection refused, errno = 111, address = localhost, port = 41838</p>
  <p>When using <a href="https://192.168.0.154:5001" rel="nofollow noreferrer">https://192.168.0.154:5001</a> in Flutter -&gt; SocketException: OS Error: Connection timed out, errno = 110, address = 192.168.0.154, port = 44624</p>
  <p>Im executing the following code:</p>
  <pre><code>    var response = await http.get(url);
      if(response.statusCode == 200) {
        print(response.body);
      }else{
        throw Exception('Failed to fetch');
      }```
  </code></pre>