10

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();
        }
    }
}
Syed Farjad Zia Zaidi
  • 3,302
  • 4
  • 27
  • 50
cosmaioan
  • 135
  • 1
  • 6

1 Answers1

19

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.

mittio
  • 346
  • 5
  • 6