Skip to content

pgrho/blazor-signalr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shipwreck.BlazorSignalR

ASP.NET SignalR connector for Blazor 3.0.0. (Not for ASP.NET Core SignalR)

Usage

  1. Install it from NuGet.
  2. Add jQuery reference to your HTML.
  3. Reference _content/Shipwreck.BlazorSignalR/Shipwreck.BlazorSignalR.js
  4. Use BlazorSignalRConnection instead of Microsoft.AspNet.SignalR.Client.HubConnection.
using Shipwreck.BlazorSignalR;

var connection = new BlazorSignalRConnection()
{
    Url = "http://your/signalr",
    QueryString = "authentication=if_needed"
};
var proxy = connection.CreatehubProxy("someHub");
proxy.On("Event1", YourCallbackMethod);
await connection.Start();
await proxy.Invoke<TResult>("Initialize", arg1, arg2);

Limitation

  • This depends on jQuery, jquery.signalR and Newtonsoft.Json. And jquery.signalR-2.4.1.js is bundled.
  • Cannot subscribe(IHubProxy.On) or unscribe(IHubProxy.Off) Hub after connection started.

License

The MIT License

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published