SpawnDev.BlazorJS.SocketIO 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package SpawnDev.BlazorJS.SocketIO --version 1.0.1                
NuGet\Install-Package SpawnDev.BlazorJS.SocketIO -Version 1.0.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SpawnDev.BlazorJS.SocketIO" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SpawnDev.BlazorJS.SocketIO --version 1.0.1                
#r "nuget: SpawnDev.BlazorJS.SocketIO, 1.0.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SpawnDev.BlazorJS.SocketIO as a Cake Addin
#addin nuget:?package=SpawnDev.BlazorJS.SocketIO&version=1.0.1

// Install SpawnDev.BlazorJS.SocketIO as a Cake Tool
#tool nuget:?package=SpawnDev.BlazorJS.SocketIO&version=1.0.1                

SpawnDev.BlazorJS.SocketIO

Bidirectional and low-latency communication for every platform.

NuGet version

SpawnDev.BlazorJS.SocketIO brings the amazing socket.io library to Blazor WebAssembly.

SpawnDev.BlazorJS.SocketIO uses SpawnDev.BlazorJS for Javascript interop allowing strongly typed, full usage of the socket.io Javascript library.

Setup

Create a new Blazor WebAssembly project
In the folder you created for your new project:

dotnet new blazorwasm

Add the Nuget package

dotnet add package SpawnDev.BlazorJS.SocketIO

Add BlazorJSRuntime service
Add to Program.cs

builder.Services.AddBlazorJSRuntime();

Add SocketIO Javascript Library
Add to index.html

<script src="_content/SpawnDev.BlazorJS.SocketIO/socket.io.min.js"></script>

(Alternatively await Socket.Init() can be used in C# to load the SocketIO library at runtime)

Create a Socket

void InitSocket(){
	Socket = new Socket("", options);
	Socket.OnConnect += Socket_OnConnect;
	Socket.OnDisconnect += Socket_OnDisconnect;
	// add event listeners for server emitted events
	Socket.On<SpeerPeerContext, string, Array, Function?>(nameof(_RelayedCall), _RelayedCall);
}
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.3.1 107 8/6/2024
1.3.0 61 7/26/2024
1.2.1 70 7/23/2024
1.2.0 95 7/17/2024
1.1.0 102 7/16/2024
1.0.1 98 7/10/2024
1.0.0 95 7/9/2024