title: Error 204 when trying to connect to SignalR
body: <p>I'm not able to connect to my SignalR Hub in a ASP.NET Core 2.0.3 application running under Windows 7.
  I'm using SignalR 1.0.0-alpha1-final from NuGet as server and the signalr-client-1.0.0-alpha2-final.min.js as JavaScript client.</p>
  
  <p>Here is my hub:</p>
  
  <pre><code>using System;
  using System.Threading.Tasks;
  using Microsoft.AspNetCore.SignalR;
  
  namespace MyProject
  {
      public class MyHub: Hub
      {
          public override async Task OnConnectedAsync()
          {
              await Clients.All.InvokeAsync("Send", $"{Context.ConnectionId} joined");
          }
  
          public Task Send(string message)
          {
              return Clients.All.InvokeAsync("Send", $"{Context.ConnectionId}: {message}");
          }    
      }
  }
  </code></pre>
  
  <p>Configure in startup.cs:</p>
  
  <pre><code>public void Configure(IApplicationBuilder app, IHostingEnvironment env)
  {
      if (env.IsDevelopment())
      {
          app.UseDeveloperExceptionPage();
          app.UseBrowserLink();
      }
      else
      {
          app.UseExceptionHandler("/Error");
      }
  
      app.UseStaticFiles();
      app.UseHangfireDashboard();
      app.UseHangfireServer();
  
      app.UseSignalR(routes =&gt;
      {
          routes.MapHub&lt;MyHub&gt;("hubs");
      });
  
      app.UseMvc(routes =&gt;
      {
          routes.MapRoute(
              name: "default",
              template: "{controller}/{action=Index}/{id?}");
      });
  }        
  </code></pre>
  
  <p>and in a test page:</p>
  
  <pre><code>let transportType = signalR.TransportType[getParameterByName('transport')] || signalR.TransportType.WebSockets;
  let http = new signalR.HttpConnection(`http://${document.location.host}/hubs`, { transport: transportType });
  var connection = new signalR.HubConnection(http);
  </code></pre>
  
  <p>but when this code executes I get an error 204 from the server. </p>
  
  <h2>UPDATE</h2>
  
  <p>Based upon the answer of @Gabriel Luci, here the working code:</p>
  
  <pre><code>let transportType = signalR.TransportType.LongPolling;
  let http = new signalR.HttpConnection(`http://${document.location.host}/hubs`, { transport: transportType });
  let connection = new signalR.HubConnection(http);
  
  connection.start();
  
  connection.on('Send', (message) =&gt; {
      console.log(message);
  });
  
  ...
  connection.invoke('Echo', "Hello ");
  </code></pre>