Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connection ID required

I am trying to build a simple chat application using SignalR with ASP.NET Core 2.0. The problem is that when I want to access one of my hub's url (localhost:5000/chat) I receive as a response: Connection ID required with error code 400. I am using auto generated from template authentication (users are stored in local db).

Here are the following components:

Startup.cs

ChatHub.cs

Any help will be really appreciated. If you need any further information - please let me know.

like image 662
Georgi Stoimenov Avatar asked Dec 18 '22 02:12

Georgi Stoimenov


1 Answers

The problem was that I have configured the hub at route /chat while my ChatController was also responsible for it. After mapping the hub to different route than the controller's one everything went fine.

I changed this: app.UseSignalR(routes => { routes.MapHub<ChatHub>("chat"); });

To this: app.UseSignalR(routes => { routes.MapHub<ChatHub>("chatter"); });

like image 127
Georgi Stoimenov Avatar answered Dec 30 '22 20:12

Georgi Stoimenov