title: SignalR .NET client works in console app but not in a windows service
body: <p>Here's my SignalR console app which works fine. It's able to receive messages from the Hub and print them onto the console.</p>
  
  <pre><code>    static void Main(string[] args)
      {
  
          MainAsync().Wait();
          Console.ReadLine();
      }
  
      static async Task MainAsync()
      {
          try
          {
  
              var hubConnection = new HubConnection("http://localhost:8080/");
              IHubProxy hubProxy = hubConnection.CreateHubProxy("MyHub");
              hubProxy.On&lt;string, string&gt;("addMessage", (name, message) =&gt;
              {
                  Console.WriteLine("Incoming data: {0} {1}", name, message);
              });
              ServicePointManager.DefaultConnectionLimit = 10;
              await hubConnection.Start();
  
          }
          catch (Exception ex)
          {
  
          }
      }
  </code></pre>
  
  <p>I created a windows service, and copied almost character for character, except the part where it prints to the console, I printed it to a log file</p>
  
  <pre><code>    protected override void OnStart(string[] args)
      {
              Log.Info("Starting...");
              StartListening().Wait();
      }
  
      private static async Task StartListening()
      {
          try
          {
              var hubConnection = new HubConnection("http://localhost:8080/");
              IHubProxy hubProxy = hubConnection.CreateHubProxy("MyHub");
              hubProxy.On&lt;string, string&gt;("addMessage", (name, message) =&gt;
              {
                  Log.Info(string.Format("Incoming data: {0} {1}", name, message));
              });
              ServicePointManager.DefaultConnectionLimit = 10;
              await hubConnection.Start();
              Log.Info("Connected");
          }
          catch (Exception ex)
          {
              Log.Error(ex);
          }
      }
  </code></pre>
  
  <p>Here's my server code:</p>
  
  <pre><code>    static void Main(string[] args)
      {
          //string url = "http://localhost:8080";
          string url = "http://*:8080";
          using (WebApp.Start(url))
          {
              MyHub hub = new MyHub();
              Console.WriteLine("Server running on {0}", url);
              var key = Console.ReadLine();
              while (key != "quit")
              {
                  hub.Send("Server", key);
              }
          }
      }
  
  public class Startup
  {
      public void Configuration(IAppBuilder app)
      {
          app.UseCors(CorsOptions.AllowAll);
          app.MapSignalR();
      }
  }
  
  public class MyHub : Hub
  {
      public void Send(string name, string message)
      {
          //Clients.All.addMessage(name, message);
          var context = GlobalHost.ConnectionManager.GetHubContext&lt;MyHub&gt;();
          context.Clients.All.addMessage(name, message);
      }
  }
  </code></pre>
  
  <p>However, nothing gets written to the log file except "Starting..." and "Connected"</p>
  
  <p>There were no exceptions thrown either.</p>
  
  <p>Do I need to include anything else or modify the code for SignalR to work on a windows service?</p>
  
  <p><strong>Update</strong></p>
  
  <p>Apparently, it seemed that changing this line</p>
  
  <pre><code>string url = "http://localhost:8080";
  </code></pre>
  
  <p>to this</p>
  
  <pre><code>string url = "http://*:8080";
  </code></pre>
  
  <p>in my server code solved my issue. But I don't know why.</p>