sgcWebSockets .NET is a complete WebSocket client and server library for C#: RFC 6455 framing, TLS, per-message-deflate compression, auto-reconnect, plus MQTT, AMQP, STOMP and WAMP sub-protocols and HTTP/2 in the same package. Install it from NuGet as esegece.sgcWebSockets or start with the free Community Edition.
The same component suite as the Delphi product, ported to C# with the same class names and the same event-driven API.
A .NET WebSocket library should cover more than the wire protocol. System.Net.WebSockets gives you RFC 6455 framing; sgcWebSockets .NET adds what production applications need on top: a server that runs on TCP or HTTP.SYS (shared ports with IIS), a client with watchdog auto-reconnect and heartbeats, message queueing, proxy and authentication support, and the messaging sub-protocols (MQTT, AMQP, STOMP, WAMP) that would otherwise mean pulling in three more dependencies.
Target-framework coverage is unusually broad: .NET Framework 2.0–4.8.1, .NET Core 1.0–3.1, .NET 5/6/7/8/9 and .NET Standard 1.6/2.0, on Windows, Linux and macOS. Legacy WinForms applications and current ASP.NET Core services use the same package and the same code.
Client
TsgcWebSocketClient: RFC 6455 client with TLS, proxy, heartbeat and watchdog
Server
TsgcWebSocketHTTPServer: WebSocket + HTTP server over HTTP.SYS, shared ports, SSL/TLS
Free: install esegece.sgcWebSockets.Community from NuGet, or download the zip for Windows, Linux 64-bit and macOS 64-bit (includes nag screen)
Features
More than WebSocket framing
The parts you would otherwise build yourself, already in the box.
WebSocket client & server
RFC 6455 on both sides, with per-message-deflate compression (RFC 7692) and TLS up to 1.3 on the provided transport.
Auto-reconnect watchdog
The client's WatchDog and HeartBeat properties keep long-lived connections alive and re-establish them after network drops, with no extra code.
Messaging protocols
MQTT 3.1.1 / 5.0, AMQP 0.9.1 / 1.0, STOMP and WAMP clients built in. Talk to RabbitMQ, HiveMQ, Azure Service Bus or ActiveMQ from the same library.
HTTP/2
A native HTTP/2 client (RFC 9113) in the same package, for APIs like Apple Push Notifications that require it.
HTTP.SYS server
The server component binds through HTTP.SYS, so it can share port 80/443 with IIS and serve HTTP and WebSocket traffic from one process.
SignalR wire clients
TsgcWSAPI_SignalR and TsgcWSAPI_SignalRCore implement the SignalR client wire protocol, so an sgcWebSockets client can talk to an existing ASP.NET Core SignalR server.
AI/LLM API clients
OpenAI, Anthropic, Gemini, DeepSeek, Grok, Ollama, Mistral and MCP clients ship in the same suite, mirroring the Delphi AI family.
Authentication & security
Client and server expose Authentication, Proxy and TLSOptions / SSLOptions property groups; the server adds an OnAuthentication event for credential checks.
Same API as Delphi
Identical Tsgc* class names and events on both platforms, so teams that run Delphi and .NET side by side maintain one mental model.
QuickStart
A client and a server in C#
Set a few properties, hook the events, set Active. That is the whole pattern.
The free Community Edition is a full working build for Windows, Linux 64-bit and macOS 64-bit that shows a nag screen, the fastest way to evaluate the library in your own solution. The .NET editions are Community, Professional and Enterprise, and all three ship the same component set, including both the WebSocket client and the WebSocket server. The commercial editions differ in licensing rather than features: Professional removes the nag screen, adds the public C# interface source and grants a commercial redistribution licence, while Enterprise adds the full C# source code for rebuilding the assemblies plus priority support.