WebRTC

Peer-to-peer real-time communication for audio, video, and data. Build video conferencing, voice calls, and low-latency data channels directly in your Delphi applications.

TsgcWSPServer_WebRTC

Server-side WebRTC signalling channel. Bind on top of a TsgcWebSocketHTTPServer, declare ICE servers, broadcast SDP / ICE candidates between peers.

Component class

TsgcWSPServer_WebRTC

Protocol

WebRTC signalling channel

Platforms

Windows, macOS, Linux, iOS, Android

Edition

Enterprise

Drop the component, set a few properties, go

Attach TsgcWSPServer_WebRTC to a TsgcWebSocketHTTPServer, push ICE servers, broadcast SDP / ICE candidates to channel subscribers.

uses
  sgcWebSocket, sgcWebSocket_Server, sgcWebSocket_Protocol_WebRTC_Server;

var
  WSServer: TsgcWebSocketHTTPServer;
  WebRTC: TsgcWSPServer_WebRTC;
begin
  WSServer := TsgcWebSocketHTTPServer.Create(nil);
  WSServer.Port := 443;
  WSServer.SSL  := True;

  WebRTC := TsgcWSPServer_WebRTC.Create(nil);
  WebRTC.Server := WSServer;

  // STUN/TURN ICE servers pushed to every joining peer
  WebRTC.WebRTC.IceServers.Add('stun:stun.l.google.com:19302');

  WebRTC.OnSubscription   := DoJoin;
  WebRTC.OnUnSubscription := DoLeave;

  WSServer.Active := True;

  // Broadcast a JSON signalling payload to every peer in a channel
  WebRTC.Broadcast('{"type":"offer","sdp":"..."}', 'room-42');
end;

What's inside

5 published properties, 2 methods, 11 events — pulled from the component reference.

Messaging

Methods: Broadcast, WriteData.

Lifecycle

Events: OnConnect, OnDisconnect, OnError.

Configuration

Published properties: WebRTC.

Diagnostics

Published properties: Guid, Version.

Server

Properties: Server, Broker.

PubSub

Events: OnBeforeSubscription, OnSubscription, OnUnSubscription.

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 — Protocol_WebRTC Full property, method and event reference for this component.
Demo Project — Demos\Protocols\WebRTC 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 Get Started with WebRTC?

Download the free trial and start building peer-to-peer communication in minutes.