title: Bad Request - Invalid Hostname when accessing localhost Web API or Web App from across LAN
body: <p>I have an ASP .Net Core 1.1 Web API and Web App running on my localhost from Visual Studio 2017 on Windows 10.</p>
  
  <p>When I run the projects, the API runs on <a href="http://localhost:50082/api/" rel="noreferrer">http://localhost:50082/api/</a> and the web app on <a href="http://localhost:60856/" rel="noreferrer">http://localhost:60856/</a></p>
  
  <p>However, if others on the LAN try to access it (using my computer's IP address - <a href="http://192.168.1.101:60856/" rel="noreferrer">http://192.168.1.101:60856/</a> they get a </p>
  
  <p>Bad Request - Invalid Hostname</p>
  
  <p>Error. In fact,. I get this error too of I use my IP address. I've tried about a dozen variations in my C:\Users\Documents\IISExpress\config\applicationhost.config file, such as:</p>
  
  <pre><code>&lt;bindings&gt;
  &lt;binding protocol="http" bindingInformation="*:60856:localhost" /&gt;
  &lt;/bindings&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>&lt;bindings&gt;
  &lt;binding protocol="http" bindingInformation="*:60856:" /&gt;
  &lt;/bindings&gt;
  </code></pre>
  
  <p>restarting the projects (and therefore IIS Express) every time, but  nothing seems to work. Any ideas?</p>