WebSocket4Net 1.0.0-beta.4

WebSocket4Net

build MyGet Version NuGet Beta Version NuGet Version NuGet Badge

A popular .NET WebSocket Client

This new version is built on SuperSocket 2.0 and modern .NET (.NET Core). It includes breaking changes from the previous WebSocket4Net version, so code adjustments may be necessary for upgrading.

Usage 1: Read messages from event handler.


using WebSocket4Net;

var websocket = new WebSocket("https://localhost/live");

websocket.PackageHandler += (sender, package) =>
{
    Console.WriteLine(package.Message);
}

await websocket.OpenAsync();

websocket.StartReceive();

await websocket.SendAsync("Hello");

//...

await websocket.CloseAsync();

Usage 1: Read messages on demand.


using WebSocket4Net;

var websocket = new WebSocket("https://localhost/live");

await websocket.OpenAsync();

await websocket.SendAsync("Hello");

while (true)
{
    var package = await websocket.ReceiveAsync();

    if (package == null)
        break;

    Console.WriteLine(package.Message);
}

//...

await websocket.CloseAsync();

Showing the top 20 packages that depend on WebSocket4Net.

Packages Downloads
SocketIoClientDotNet
This is the Socket.IO Client Library for .NET.
40
SocketIoClientDotNet
This is the Socket.IO Client Library for C#.
36
EngineIoClientDotNet
This is the Engine.IO Client Library for C#.
35
EngineIoClientDotNet
This is the Engine.IO Client Library for C#.
34
QuantConnect.ToolBox
QuantConnect LEAN Engine: ToolBox Project - A collection of data downloaders and converters
33
SocketIoClientDotNet
This is the Socket.IO Client Library for C#.
29
EngineIoClientDotNet
This is the Engine.IO Client Library for C#.
29
SocketIoClientDotNet
This is the Socket.IO Client Library for C#.
28
EngineIoClientDotNet
This is the Engine.IO Client Library for C#.
28
SocketIoClientDotNet
This is the Socket.IO Client Library for .NET.
27
EngineIoClientDotNet
This is the Engine.IO Client Library for C#.
27
SocketIoClientDotNet
This is the Socket.IO Client Library for C#.
27
EngineIoClientDotNet
This is the Engine.IO Client Library for C#.
26
SocketIoClientDotNet
This is the Socket.IO Client Library for C#.
26
QuantConnect.ToolBox
QuantConnect LEAN Engine: ToolBox Project - A collection of data downloaders and converters
26

.NET 5.0

.NET 6.0

.NET 7.0

.NET 7.0

.NET 7.0

.NET 7.0

.NET 7.0

.NET 8.0

.NET 8.0

.NET 8.0

.NET 8.0

.NET 8.0

.NET Standard 2.1

Version Downloads Last updated
1.0.0-beta.5 35 12/15/2025
1.0.0-beta.4 31 12/13/2025
1.0.0-beta.3 23 12/13/2025
1.0.0-beta.2 27 12/14/2025
1.0.0-beta.1 28 12/14/2025
0.15.2 28 12/13/2025
0.15.1 23 12/16/2025
0.15.0 23 12/21/2025
0.15.0-beta9 40 12/20/2025
0.15.0-beta8 28 12/20/2025
0.15.0-beta7 26 12/14/2025
0.15.0-beta6 29 12/20/2025
0.15.0-beta5 22 12/13/2025
0.15.0-beta4 37 12/13/2025
0.15.0-beta3 25 12/13/2025
0.15.0-beta2 27 12/20/2025
0.15.0-beta1 31 12/14/2025
0.14.1 38 12/15/2025
0.14.0 24 12/13/2025
0.13.1 22 12/09/2025
0.13.0 24 12/14/2025
0.12.0 30 12/11/2025
0.11.0 28 12/13/2025
0.10.0 28 12/13/2025
0.9.0 26 12/13/2025
0.8.0 30 12/13/2025
0.7.0 27 12/21/2025
0.5.1 29 12/21/2025
0.4.0 33 12/10/2025