Search code examples
c#owinkatana

How to Configure owin/Katana to listen on all host ip addresses


How to configure an owin web server to be accessible from other hosts. All the examples are configured for localhost. I might not know what is the URL. (ip address/host name)

Code:

class Program
{
    static string url = "http://localhost:9080";
    static void Main(string[] args)
    {
        using (WebApp.Start<Startup>(url))
        {
            Console.WriteLine("Server running on {0}", url);
            Console.ReadLine();
        }
    }
}

Solution

  • You can change your url to listen on all adapters by using the '*':

    static string url = "http://*:9080";
    

    This will be less restrictive than localhost.