SignalR on .NET 6 - the Complete Guide
Minimum price
Suggested price

SignalR on .NET 6 - the Complete Guide

The easiest way to enable real-time two-way HTTP communication on .NET 6

About the Book

Are you a software engineer who needs to build a fully interactive application with real-time updates? Perhaps you are aiming to write an instant messaging app. Or perhaps you want to receive updates about someone's location in real time. Or maybe you have a fleet of responsive Internet of Things devices that you need to get to communicate in real time with each other and the server.

It is a very common challenge of modern software development. If your application isn't Interactive enough, the market will simply reject it. Most apps of today are expected to be interactive. But unfortunately, such functionality is typically hard to implement.

However, if you choose to build your server-side application on ASP.NET Core, you are in luck. There is a way to make this whole process incredibly easy. It's made easy by a library called SignalR, which is inbuilt in ASP.NET Core.

SignalR doesn't only enable us to achieve real-time two-way communication between applications. It also substantially simplifies the process of enabling all of this in the code. Under the hood, it uses various two-way communication protocols, such as WebSocket. However, it abstracts away all the implementation complexity of these protocols. To the developer, working with this library will mostly consists of writing simple, intuitive, and easily readable expressions.

In this book, we will cover everything you would need to know about using SignalR on .NET 6, so you will see how to integrate it with the the latest features on ASP.NET Core 6 and C# 10. We will cover much more than you can find in the official documentation of the library. For example, you will learn how to connect a plain WebSocket client to it, which may help you to write a client in a language that isn't officially supported.

Likewise, we will cover many concepts that aren't directly related to SignalR, but are important for its production-ready implementation. These include single sign-on, certificate authorization, logging, metrics, and scaling out. By the end of this book, you would be able to identify the situations where SignalR is the best tool for the job and you would be fully capable of implementing it.

  • Share this book

  • Categories

    • C#
    • ASP.NET
    • .NET
    • APIs
    • Cloud Computing
    • Web Development
    • Internet of Things
    • Computers and Programming
  • Feedback

    Email the Author(s)

About the Author

Fiodar Sazanavets
Fiodar Sazanavets

Fiodar Sazanavets is an experienced lead software engineer whose main area of expertise is Microsoft stack, which includes ASP.NET (Framework and Core), SQL Server, Azure, and various front-end technologies. Fiodar is familiar with industry-wide best practices, such as SOLID principles, software design patterns, automation testing principles (BDD and TDD) and microservices architecture.

Fiodar has built his software engineering experience while working in a variety of industries, including water engineering, financial, retail, railway and defence. He has played a leading role in various projects and, as well as writing software, he gained substantial experience in architecture and design.

Fiodar is an author of a number of technical books and online courses. He regularly writes about software development on his personal website, He is also available to book for personal mentoring sessions via

Bundles that include this book

Bought separately
Bundle Price

Reader Testimonials

Vache Chek
Vache Chek

I would recommend this book

Very easy to read. Informative with good code samples!

Dikaios Papadogkonas
Dikaios Papadogkonas

All you need to create reactive applications

Another great book by Fiodar. It is well written and contains the appropriate amount of information needed to get the job done.

Table of Contents

  • 1 - Introduction to SignalR
    • What makes SignalR so great
    • Example use cases for SignalR
    • Who is this book for
    • The scope of this book
    • Prerequisites
    • How to use this book
    • Book structure
    • About the author
    • Getting in touch with the author
  • 2 - Setting up your project
    • Prerequisites
    • Setting up your environment
    • Setting up SignalR hub
    • Making SignalR hub strongly-typed
    • Summary
    • Test yourself
    • Further reading
  • 3 - In-browser SignalR clients
    • Prerequisites
    • Setting up JavaScript client
    • Setting up Blazor WebAssembly client
    • Summary
    • Test yourself
    • Further reading
  • 4 - External SignalR clients
    • Prerequisites
    • Setting up .NET client
    • Setting up Java client
    • Setting up a raw WebSocket client
    • Summary
    • Test yourself
    • Further reading
  • 5 - Sending messages to individual clients or groups of clients
    • Prerequisites
    • Broadcasting messages to all clients
    • Sending messages to specific clients
    • Working with client groups
    • Summary
    • Test yourself
    • Further reading
  • 6 - Streaming in SignalR
    • Prerequisites
    • What is streaming used for
    • Client streaming in SignalR
    • Server streaming in SignalR
    • Summary
    • Test yourself
    • Further reading
  • 7 - Advanced SignalR configuration
    • Prerequisites
    • Configuring SignalR server
    • Configuring SignalR client
    • Pros and cons of MessagePack protocol
    • Summary
    • Test yourself
    • Further reading
  • 8 - Securing your SignalR applications
    • Prerequisites
    • What is CORS and why it’s important
    • Setting up single sign-on provider
    • Applying authentication in SignalR
    • Applying authorization in SignalR
    • Summary
    • Test yourself
    • Further reading
  • 9 - Scaling out SignalR application
    • Prerequisites
    • Setting up Redis backplane
    • Running multiple hub instances via Redis backplane
    • Using HubContext to send messages from outside SignalR hub
    • Summary
    • Test yourself
    • Further reading
  • 10 - Introducing Azure SignalR Service
    • Prerequisites
    • Setting up Azure SignalR Service
    • Adding Azure SignalR Service dependencies to your application
    • Overview of Azure SignalR Service REST API
    • Summary
    • Test yourself
    • Further reading
    • Wrapping up
  • Answers to self-assessment questions
    • Chapter 2
    • Chapter 3
    • Chapter 4
    • Chapter 5
    • Chapter 6
    • Chapter 7
    • Chapter 8
    • Chapter 9
    • Chapter 10

The Leanpub 60-day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms

80% Royalties. Earn $16 on a $20 book.

We pay 80% royalties. That's not a typo: you earn $16 on a $20 sale. If we sell 5000 non-refunded copies of your book or course for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earnedover $12 millionwriting, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub