Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c#

owin

katana

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();
        }
    }
}
like image 621
cosmaioan Avatar asked Oct 10 '14 10:10

cosmaioan


1 Answers

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.

like image 80
mittio Avatar answered Nov 10 '22 16:11

mittio