title: SignalR Client Connection has been not established
body: <p>I created a SignalR Selfhosted application but can not access via browsers or Windows Phone (which is my client). I followed several tutorials and they pretty much say the same thing, I believe that the error is on my network configuration also notice that when you run the project, the IIS does not fire (not sure if it is also required).</p>
  
  <p>SignalRServer:</p>
  
  <pre><code>class Program : Hub
      {
          private static HubConnection Connection { get; set; }
          private static IHubProxy HubProxy { get; set; }
  
          const string Url = "http://*:8080";
  
          static void Main(string[] args)
          {
              // This will *ONLY* bind to localhost, if you want to bind to all addresses
              // use http://*:8080 to bind to all addresses. 
              // See http://msdn.microsoft.com/en-us/library/system.net.httplistener.aspx 
              // for more information.
  
              using (WebApp.Start(Url))
              {
                  Console.WriteLine("Servidor rodando em {0}", Url);
                  Console.ReadLine();
              }
          }
  
          private static void Connection_Closed()
          {
              Connection = null;
          }
      }
  
      class Startup
      {
          public void Configuration(IAppBuilder app)
          {
              app.UseCors(CorsOptions.AllowAll);
              app.MapSignalR();
          }
      }
  </code></pre>
  
  <p>The error is:</p>
  
  <blockquote>
    <p>The connection has not been established.</p>
  </blockquote>
  
  <p>My Client class:</p>
  
  <pre><code>public class SignalRService : PhoneApplicationPage
      {
          public String UserName { get; set; }
  
          public IHubProxy HubProxy { get; set; }
  
          private const string ServerURI = "http://localhost:8080";
  
          public HubConnection Connection { get; set; }
  
          public SignalRService()
          {
              UserName = "Luizaooo";
  
              ConnectAsync();
          }
  
          public void ObterAtualizacoesProdutos()
          {
              ProdutoService produtoService = new ProdutoService();
              var dataHora = produtoService.ObterDataHoraUltimaAtualizacao();
              HubProxy.Invoke("ObterAtualizacoes", dataHora);
              MessageBox.Show("passou");
          }
  
          private async void ConnectAsync()
          {
              Connection = new HubConnection(ServerURI);
              Connection.Closed += Connection_Closed;
              HubProxy = Connection.CreateHubProxy("ProdutoHub");
  
              HubProxy.On&lt;List&lt;Produto&gt;&gt;("AtualizarProdutos", (ListaDeProdutos) =&gt;
                  this.Dispatcher.BeginInvoke(() =&gt;
                  {
                      var a = ListaDeProdutos;
                  }));
  
              try
              {
                  await Connection.Start();
              }
              catch (Exception e)
              {
                  MessageBox.Show(e.Message);
                  return;
              }
          }
  
          private void Connection_Closed()
          {
              Connection = null;
          }
      }
  </code></pre>