0Pricing
C# Academy · Lesson

SignalR Hubs & Connections

Create a SignalR hub, map it in ASP.NET Core, and establish WebSocket connections from JavaScript and .NET clients.

What Is SignalR?

SignalR is an ASP.NET Core library that adds real-time, bidirectional communication between server and clients. It automatically picks the best transport — WebSockets, Server-Sent Events, or Long Polling — based on what both sides support.

Setting Up SignalR

Add SignalR to services and map a hub endpoint. A hub is a class that handles client connections and method calls.

builder.Services.AddSignalR();

var app = builder.Build();

app.UseCors("AllowAll");
app.MapHub<ChatHub>("/hubs/chat");

app.Run();

All lessons in this course

  1. SignalR Hubs & Connections
  2. Groups, Users & Connection Management
  3. Strongly Typed Hubs
  4. Scaling with Redis Backplane
← Back to C# Academy