Search code examples
c#asp.net-mvckestrel-http-server

ASP.NET 5 Kestrel connect within LAN


I would like to connect to my Kestrel server with ASP.NET 5 application hosted on it from another PC in the same network. Is it possible? I can ping my computer from cmd, but I get 'Connection timed out' when I try to connect from a web browser (I type this: "http://{my_kestrel_ip}:5000/").


Solution

  • In your project folder you should have a file called hosting.ini. In that file by default you should have something like this:

    server=Kestrel
    server.urls=http://localhost:5000
    

    You need to make the HTTP server listen on your public IP address as well as localhost. To do that, you can add an additional address by separating them with a semi colon:

    server.urls=http://localhost:5000;http://{my_kestrel_ip}:5000