WebSocket4Net 1.0.0-beta.5

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.
60
SocketIoClientDotNet
This is the Socket.IO Client Library for C#.
55
EngineIoClientDotNet
This is the Engine.IO Client Library for C#.
46
EngineIoClientDotNet
This is the Engine.IO Client Library for C#.
42
SocketIoClientDotNet
This is the Socket.IO Client Library for .NET.
42
QuantConnect.ToolBox
QuantConnect LEAN Engine: ToolBox Project - A collection of data downloaders and converters
40
SocketIoClientDotNet
This is the Socket.IO Client Library for C#.
39
EngineIoClientDotNet
This is the Engine.IO Client Library for C#.
37
SocketIoClientDotNet
This is the Socket.IO Client Library for C#.
37
SocketIoClientDotNet
This is the Socket.IO Client Library for C#.
36
EngineIoClientDotNet
This is the Engine.IO Client Library for C#.
36
SocketIoClientDotNet
This is the Socket.IO Client Library for .NET.
35
EngineIoClientDotNet
This is the Engine.IO Client Library for C#.
34
SocketIoClientDotNet
This is the Socket.IO Client Library for C#.
34
QuantConnect.ToolBox
QuantConnect LEAN Engine: ToolBox Project - A collection of data downloaders and converters
34

.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 43 12/15/2025
1.0.0-beta.4 36 12/13/2025
1.0.0-beta.3 31 12/13/2025
1.0.0-beta.2 35 12/14/2025
1.0.0-beta.1 41 12/14/2025
0.15.2 36 12/13/2025
0.15.1 31 12/16/2025
0.15.0 31 12/21/2025
0.15.0-beta9 51 12/20/2025
0.15.0-beta8 36 12/20/2025
0.15.0-beta7 35 12/14/2025
0.15.0-beta6 37 12/20/2025
0.15.0-beta5 30 12/13/2025
0.15.0-beta4 48 12/13/2025
0.15.0-beta3 34 12/13/2025
0.15.0-beta2 38 12/20/2025
0.15.0-beta1 39 12/14/2025
0.14.1 51 12/15/2025
0.14.0 34 12/13/2025
0.13.1 7 10/05/2026
0.13.0 34 12/14/2025
0.12.0 36 12/11/2025
0.11.0 37 12/13/2025
0.10.0 39 12/13/2025
0.9.0 36 12/13/2025
0.8.0 36 12/13/2025
0.7.0 36 12/21/2025
0.5.1 36 12/21/2025
0.4.0 4 10/04/2026