BlazorHeartbeat is a Blazor component that maintains the SignalR connection in a Server side Blazor application. It is particularly useful when your application is hosted behind an Application Gateway with a connection timeout.
Don't hesitate to post issue, pull request on the project or to fork and improve the project.
BlazorHeartbeat project is written by Xavier Solau. It's licensed under the MIT license.
You can checkout this Github repository or you can use the NuGet package:
Install using the command line from the Package Manager:
Install-Package SoloX.BlazorHeartbeat -version 1.0.0
Install using the .Net CLI:
dotnet add package SoloX.BlazorHeartbeat --version 1.0.0
Install editing your project file (csproj):
<PackageReference Include="SoloX.BlazorHeartbeat" Version="1.0.0" />
Note that you can find code examples in this repository in this location: src/examples
.
Basically, all you need to do is to add the Heartbeat
element at the end of the App.rasor
file in your Blazor Server-Side application.
You can optionally specify the PingDelay.
<Heartbeat PingDelay="60000" />
Don't forget to add the using directive in the _Imports.razor
file:
@using SoloX.BlazorHeartbeat