2014-10-10 116 views
7

如何将owin web服务器配置为可从其他主机访问。所有示例都配置为localhost。我可能不知道URL是什么。 (IP地址/主机名)如何配置owin/katana以侦听所有主机ip地址

代码:

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(); 
     } 
    } 
} 

回答

14

您可以通过使用 '*' 改变你的网址监听所有适配器:

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

这将减少限制比本地主机。

相关问题