title: FastAPI/uvicorn not working when specifying host
body: <p>I'm running a FastAPI app in Python using uvicorn on a Windows machine.  It works fine when I either</p>
  <ol>
  <li>Run the following code on my mac, or</li>
  <li>When I don't specify the port for uvicorn (remove the <code>host</code> parameter from the uvicorn.run call)</li>
  <li>When I specify port '127.0.0.1', which is the host it uses when I don't specify a host at all.</li>
  </ol>
  <pre><code>from fastapi import FastAPI
  import uvicorn
  
  app = FastAPI()
  
  
  @app.get(&quot;/&quot;)
  async def root():
      return {&quot;message&quot;: &quot;Hello World&quot;}
  
  
  if __name__ == '__main__':
      uvicorn.run(app, port=8080, host='0.0.0.0')
  </code></pre>
  <p>When I go to 0.0.0.0:8080 on my browser, I get an error that says &quot;This site can’t be reached&quot;.</p>
  <p>I have checked my current active ports to make sure I'm not getting a collision using <code>netstat -ao |find /i &quot;listening&quot;</code> and 0.0.0.0:8080 is not in use.</p>
  <p>My current file configuration looks like this:</p>
  <pre><code>working_directory
  └── app
      ├── gunicorn_conf.py
      └── main.py
  </code></pre>
  <p>My gunicorn_conf.py is super simple and just tries to set the host and port:</p>
  <pre><code>host = &quot;0.0.0.0&quot;
  port = &quot;8080&quot;
  </code></pre>
  <p>How can I get this to work when I specify host '0.0.0.0'?</p>