Custom Protocols
Built-in custom protocols that extend WebSocket with RPC, file transfers, dataset synchronization, presence awareness, and end-to-end encryption.
Built-in custom protocols that extend WebSocket with RPC, file transfers, dataset synchronization, presence awareness, and end-to-end encryption.
sgcWebSockets includes several custom protocols that add high-level functionality on top of WebSocket connections.
JSON-RPC 2.0 based protocol supporting RPC calls, publish-subscribe, transactional messages, QoS, and message acknowledgment.
Binary WebSocket transport for transferring files between connected clients with configurable packet sizes, authorization, and QoS.
Broadcast dataset modifications across multiple connected clients for real-time data synchronization.
Channel-based user presence awareness for chat, collaboration, shared browsing, and multiplayer applications.
End-to-end encryption protocol ensuring messages are encrypted on the sender and decrypted only by the intended recipient.
The SGC protocol is the most versatile custom protocol, supporting RPC and pub-sub patterns.
uses
sgcWebSocket_Client, sgcWebSocket_Types,
sgcWebSocket_Protocol_sgc_Client;
var
WSClient: TsgcWebSocketClient;
SGCProtocol: TsgcWSPClient_sgc;
procedure TForm1.FormCreate(Sender: TObject);
begin
WSClient := TsgcWebSocketClient.Create(nil);
WSClient.Host := 'myserver.example.com';
WSClient.Port := 443;
SGCProtocol := TsgcWSPClient_sgc.Create(nil);
SGCProtocol.Client := WSClient;
SGCProtocol.OnMessage := OnSGCMessage;
WSClient.Active := True;
end;
procedure TForm1.OnSGCMessage(Connection: TsgcWSConnection;
const aMessage: string);
begin
Memo1.Lines.Add('Received: ' + aMessage);
end;