WebBroker + WebSockets

Indy-based WebBroker / DataSnap host that also accepts native WebSocket upgrades on the same port. Cross-platform — runs on Windows, Linux and macOS.

TsgcWSHTTPWebBrokerBridgeServer

Bridges Embarcadero's WebBroker pipeline (TWebModule, DataSnap REST, RAD Server) onto the cross-platform Indy server, with native WebSocket upgrade handling on the same listener.

Component class

TsgcWSHTTPWebBrokerBridgeServer

Platforms

Windows, macOS, Linux, iOS, Android

Edition

Enterprise

Set port + WebModule, listen

Mount your TWebModule via WebRequestHandler, configure the bridge server's port and SSL, attach OnConnect for the WebSocket upgrade path, then Active := True.

uses
  sgcWebSocket, sgcWebSocket_DataSnap, WebReq, WebModuleUnit1;

var
  Server: TsgcWSHTTPWebBrokerBridgeServer;
begin
  if WebRequestHandler <> nil then
    WebRequestHandler.WebModuleClass := WebModuleClass;

  Server := TsgcWSHTTPWebBrokerBridgeServer.Create(nil);
  Server.Port := 8080;

  // the same server accepts WebSocket upgrades
  Server.OnMessage := procedure(Connection: TsgcWSConnection;
    const aText: string)
  begin
    Connection.WriteData('echo: ' + aText);
  end;

  Server.Active := True;
end;

What's inside

A pure-Delphi cross-platform WebBroker host — works on Linux as well as Windows, including DataSnap REST and RAD Server endpoints.

WebBroker dispatch

Inbound HTTP requests run through the standard WebRequestHandler / WebModule chain, so existing DataSnap REST and TWebModule handlers work unchanged.

Native WebSocket

WebSocket upgrades are handled in the same component — OnMessage, OnBinary, OnConnect, OnDisconnect are all available alongside HTTP.

TLS via OpenSSL

Configure SSLOptions (CertFile / KeyFile / RootCertFile) for HTTPS — the same TLS settings cover both HTTP and WebSocket traffic.

Cross-platform

Runs anywhere Indy runs — Windows, Linux 64, macOS — making it the natural pick for DataSnap services that need to deploy beyond Windows.

CORS & redirects

CORS preflight handling, route-based redirects and IP filtering are exposed as properties — no need to hand-roll them in every WebModule.

Companion HTTP/2 server

For the same WebBroker stack with HTTP/2 support use the sibling TsgcWSHTTP2WebBrokerBridgeServer — identical surface, plus HTTP/2 framing.

Specifications & references

Authoritative sources for the protocols this component implements.

Documentation & Demos

Deep-link to the component reference, grab the ready-to-run demo project, and download the trial.

Online Help — TsgcWSHTTPWebBrokerBridgeServer Full property, method and event reference for this component.
Demo Project — Demos\40.DataSnap\Server_Indy_HTTP Ready-to-run example project. Ships inside the sgcWebSockets package — download the trial below.
Technical Document (PDF) Features, quick start, code samples for Delphi & C++ Builder and primary-source references — this component only.
User Manual (PDF) Comprehensive manual covering every component in the library.

Ready to Modernise Your DataSnap Server?

Download the free trial and add WebSocket support to your existing WebBroker / DataSnap modules.