SignalR on .NET 6 - the Complete Guide
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.
Bundles that include this book
Reader Testimonials
Vache Chek
I would recommend this book
Very easy to read. Informative with good code samples!
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.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $13 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