title: SignalR core console client not receiving notifications
body: <p>I have looked around at some of the Similar questions and didn't figure this problem out.  I have a simple Hub in my .NET core Web API project.  Here is the Hub:</p>
  
  <pre><code> public class NotificationHub : Hub&lt;INotificationClient&gt;
  {
    public async Task SendMessage(string user, string msg)
      {
          await Clients.All.ReceiveMessage(user, msg);
      }
      public Task SendMessageToCaller(string msg)
      {
          return Clients.Caller.ReceiveMessage(msg);
      }
  
      public Task SendMessageToPartner(string user, string msg)
      {
          return Clients.Client(user).ReceiveMessageToPartner(msg);
      }
  }
  </code></pre>
  
  <p>Here is the Interface:</p>
  
  <pre><code> public interface INotificationClient
  {
      Task ReceiveMessage(string user, string msg);
      Task ReceiveMessage(string msg);
      Task ReceiveMessageToPartner( string msg);
  
  }
  </code></pre>
  
  <p>Here is the code from the controller:</p>
  
  <pre><code>[Route("[controller]")]
  [ApiController]
  public class NotificationsController : ControllerBase
  {
      private IHubContext&lt;NotificationHub&gt; _hub;
  
      public NotificationsController(IHubContext&lt;NotificationHub&gt; hub)
      {
          _hub = hub;
  
      }
      [HttpGet]
      public async Task&lt;IActionResult&gt; Get()
      {
          var msg = new NotificationData { ClientId = "12345", Notification = "Somone just connected" };
          await _hub.Clients.All.SendAsync("Notification", msg);
          return Ok(new { Message = "Request complete" });
      }
  }
  </code></pre>
  
  <p>Lastly here is the console client code:</p>
  
  <pre><code> Console.WriteLine("Press a key to start listening");
          Console.ReadKey();
  
          Console.WriteLine("Client Listening!");
          var connection = new HubConnectionBuilder()
             .WithUrl("http://localhost:61514/notifications")
  
             .Build();
  
  
          connection.On&lt;NotificationData&gt;("Notification", (notificationData) =&gt;
              Console.WriteLine($"Somebody connected: {notificationData.ClientId}"));
  
          connection.StartAsync().GetAwaiter().GetResult();
  
          Console.WriteLine("Listening. Press a key to quit");
          Console.ReadKey();
  </code></pre>
  
  <p>Here is the startup of the web app with the mappings:</p>
  
  <pre><code> public void ConfigureServices(IServiceCollection services)
      {
          services.AddSignalR();
          services.AddControllers();
      }
  
      // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
      public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
      {
          if (env.IsDevelopment())
          {
              app.UseDeveloperExceptionPage();
          }
  
          app.UseRouting();
  
          app.UseEndpoints(endpoints =&gt;
          {
              endpoints.MapControllers();
              endpoints.MapHub&lt;NotificationHub&gt;("/Notifications");
          });
      }
  </code></pre>
  
  <p>I keep getting this error:  System.IO.IOException: 'The server disconnected before the handshake could be started.'  I must be missing something along the way here. </p>
  
  <p>Update:<br>
  Turned on the logs and got this error:</p>
  
  <blockquote>
    <p>dbug: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[8]
          Establishing connection with server at '<a href="http://localhost:61514/notifications" rel="nofollow noreferrer">http://localhost:61514/notifications</a>'.
    dbug: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[9]
          Established connection 'BdROAEEQnGUeDYAW5EspRA' with the server.
    dbug: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[7]
          Starting transport 'ServerSentEvents' with Url: <a href="http://localhost:61514/notifications" rel="nofollow noreferrer">http://localhost:61514/notifications</a>.
    info: Microsoft.AspNetCore.Http.Connections.Client.Internal.ServerSentEventsTransport[1]
          Starting transport. Transfer mode: Text.
    dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.ServerSentEventsTransport[3]
          Starting receive loop.
    dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.ServerSentEventsTransport[9]
          Received 30 bytes. Parsing SSE frame.
    dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.ServerSentEventsTransport[4]
          Receive loop stopped.
    dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.ServerSentEventsTransport[100]
          Starting the send loop.
    dbug: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[18]
          Transport 'ServerSentEvents' started.
    dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.ServerSentEventsTransport[102]
          Send loop canceled.
    dbug: Microsoft.AspNetCore.Http.Connections.Client.Internal.ServerSentEventsTransport[101]
          Send loop stopped.
    Unhandled exception. info: Microsoft.AspNetCore.Http.Connections.Client.HttpConnection[3]
          HttpConnection Started.
    info: Microsoft.AspNetCore.SignalR.Client.HubConnection[24]
          Using HubProtocol 'json v1'.
    System.IO.IOException: The server disconnected before the handshake could be started.
       at Microsoft.AspNetCore.SignalR.Client.HubConnection.HandshakeAsync(ConnectionState startingConnectionState, CancellationToken cancellationToken)
       at Microsoft.AspNetCore.SignalR.Client.HubConnection.StartAsyncCore(CancellationToken cancellationToken)
       at Microsoft.AspNetCore.SignalR.Client.HubConnection.StartAsyncCore(CancellationToken cancellationToken)
       at Microsoft.AspNetCore.SignalR.Client.HubConnection.StartAsyncInner(CancellationToken cancellationToken)
       at System.Threading.Tasks.ForceAsyncAwaiter.GetResult()
       at Microsoft.AspNetCore.SignalR.Client.HubConnection.StartAsync(CancellationToken cancellationToken)
       at NotificationClient.Program.Main(String[] args) </p>
  </blockquote>