Features Overview

sgcWebSockets is a cross-platform library enabling real-time client-server communication. Built entirely in Delphi, it supports Windows, Linux, macOS, iOS, and Android with optimized performance for low-latency, high-throughput applications.

Platform & Protocol Support

A rock-solid foundation for every real-time application.

Cross-Platform

Windows, Linux 64-bit, macOS, iOS, and Android. Full VCL and FireMonkey support from a single codebase.

Multithreaded Server

RFC 6455 compliant WebSocket server with IOCP on Windows and EPOLL on Linux for maximum concurrent connections.

SSL/TLS 1.2 & 1.3

Full encryption on server and client with OpenSSL and SChannel backends. Built-in certificate management.

Binary & Unicode

Full support for binary frames and Unicode text messages. Transfer files, images, and structured data natively.

Message Compression

PerMessage-Deflate extension reduces bandwidth by up to 80% with configurable compression levels.

Multi-Protocol Server

WebSocket, HTTP/1.1, and HTTP/2.0 connections on the same port. No separate servers needed.

Connection & Messaging

Built-in mechanisms to keep connections healthy and messages delivered.

HeartBeat

Automatic ping/pong at configurable intervals. Detects dead connections early and keeps them alive through firewalls.

WatchDog

Automatic reconnection for clients and auto-restart for servers after unexpected disconnections. Zero-downtime recovery.

Quality of Service

Three QoS levels: at most once, at least once, and exactly once delivery for every reliability requirement.

Message Queuing

Persistent message storage with configurable levels. Replay missed messages after reconnection.

Transactions

StartTransaction, Commit, and Rollback methods for atomic multi-step operations.

Bandwidth Throttling

Limit bits per second per connection. Prevent bandwidth abuse and ensure fair resource allocation.

Authentication Methods

Multiple strategies to secure your WebSocket connections.

Basic Authentication

Standard HTTP Basic authentication for username/password credential validation.

OAuth2

Full OAuth2 support for client and server. Integrate with identity providers for token-based authentication.

Session & URL Authentication

Server-side session management and token-based URL parameter authentication for browser clients.

Quick Start Example

Create a WebSocket server with just a few lines of Delphi code.

uses
  sgcWebSocket_Server, sgcWebSocket_Types;

var
  WSServer: TsgcWebSocketHTTPServer;

procedure TForm1.FormCreate(Sender: TObject);
begin
  WSServer := TsgcWebSocketHTTPServer.Create(nil);
  WSServer.Port := 8080;
  WSServer.SSL := True;
  WSServer.OnMessage := OnMessage;
  WSServer.Active := True;
end;

procedure TForm1.OnMessage(Connection: TsgcWSConnection;
  const aText: string);
begin
  // Echo the message back to the client
  Connection.WriteData(aText);
end;

Ready to Get Started?

Download the free trial and start building real-time applications in minutes.