Ecng system framework
$ dotnet add package Ecng.Net.SocketIOClient library implementing the Socket.IO protocol.
Provides a high-level API for real-time communication over WebSockets.
var ws = new ClientWebSocket();
await ws.ConnectAsync(new Uri(url), CancellationToken.None);
// handshake and message parsing required
var socket = new WebSocketClient(
url,
state => Console.WriteLine($"State: {state}"),
ex => Console.WriteLine(ex),
(c, msg, ct) => { Console.WriteLine(msg.Text); return ValueTask.CompletedTask; },
Console.WriteLine,
Console.Error.WriteLine,
Console.WriteLine);
await socket.ConnectAsync();
socket.Send(new { hello = "world" });