ASP.NET Core SignalR is an open-source library that simplifies the ability to add real-time web functionality to applications. Real-time web functionality allows server-side code to instantly push content to clients.
For SignalR :
Apps that require frequent updates from the server. Examples include games, social networks, polls, auctions, maps, and GPS apps. Dashboards and monitoring applications. Examples include company dashboards, instant sales updates, or travel alerts. Collaborative applications. Examples of collaboration apps include whiteboard apps and team meeting software. Apps that require notifications. Social networks, email, chat, gaming, travel alerts, and many other apps all use notifications.
review
documentation
The hyperlink login is visible.
The hyperlink login is visible.
About the configuration
The hyperlink login is visible.
Authorization verification
The hyperlink login is visible.
First, let's take a look at the renderings to simulate SignalR being deployed on different servers, as shown below:
Create a new project that ASP.NET Core 3.1
In Solution Explorer, right-click the project and select Add > Client Libraries. In the Add Client Library dialog box, for Provider, select unpkg. For Library, enter@microsoft/signalr@latest。 Select Select Select Specific Files, expand the Dist/Browser folder, and select signalr.js and signalr.min.js. Set the Target Location to wwwroot/js/signalr/ and select Install.
Create a new TestHub file in your project,Authentication is supported, the code is as follows:
To support distribution, you need to install the Microsoft.AspNetCore.SignalR.StackExchangeRedis package, using the nuget installation command as follows:
In the Startup files ConfigureServices and Configure to register the service and configuration, the code is as follows:
The main code on the frontend is as follows:
YesProactively push messages to users through the controller, the code is as follows:
Source code download:The hyperlink login is visible.
|