Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Bad Request - Invalid Hostname when accessing localhost Web API or Web App from across LAN

$
0
0

I have an ASP .Net Core 1.1 Web API and Web App running on my localhost from Visual Studio 2017 on Windows 10.

When I run the projects, the API runs on http://localhost:50082/api/ and the web app on http://localhost:60856/

However, if others on the LAN try to access it (using my computer's IP address - http://192.168.1.101:60856/ they get a 

Bad Request - Invalid Hostname

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\<username>Documents\IISExpress\config\applicationhost.config file, such as:

    <bindings>
    <binding protocol="http" bindingInformation="*:60856:localhost" />
    </bindings>

and

    <bindings>
    <binding protocol="http" bindingInformation="*:60856:" />
    </bindings>

restarting the projects (and therefore IIS Express) every time, but  nothing seems to work. Any ideas?

P.S. I have also turned off my firewall, and do not have any 3rd party anti-viruses running...


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>