title: Issue with Web API Hosted on Windows Service
body: <p>I have a web api written and hosted on top of a windows service and it works fine with the internal network. Now I need to run this windows service on a public domain machine which got public IP for external sources and internal Ip for the intranet. I can't get the web api to access requests coming through public IP for some reason. Some code extracted listed below to make it easy for you all to understand what I am doing. I am new to web api and any suggestions, improvements are always welcome!
  Up to now I have tried using *, + in the baseURL which will bypass this issue to specify the IP in the OnStart() but it will then always return me Bad Request when it tries to extract the Request Stream.
  I think I am not translating the public IP to internal IP correctly here and I do not know how to do it.
  Please help!</p>
  
  <p><strong>OnStart() of windows service</strong>                    </p>
  
  <pre><code>IPHostEntry host;
  host = Dns.GetHostEntry(Dns.GetHostName());
  
  foreach (IPAddress ip in host.AddressList)
     if (ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
                              address = ip.ToString();
         if (string.IsNullOrEmpty(address))
            address = "localhost";
         string baseAddress = "http://" + address  + ":9000/";
         WebApp.Start&lt;StartUp&gt;(url: baseAddress);
  </code></pre>