// Create websocket client and set server options
oClient := TsgcWebSocketClient.Create(nil);
oClient.Host := 'www.esegece.com';
oClient.Port := 15674;
oClient.Options.Parameters := '/ws';
// Create STOMP protocol and assign to websocket client
oSTOMP := TsgcWSPClient_STOMP.Create(nil);
oSTOMP.Client := oClient;
// STOMP Authentication
oSTOMP.Authentication.Enabled := True;
oSTOMP.Authentication.Username := 'sgc';
oSTOMP.Authentication.Password := 'sgc';
// Handle STOMP methods
oSTOMP.OnSTOMPConnect := OnSTOMPConnectHandler;
oSTOMP.OnSTOMPMessage := OnSTOMPMessageHandler;
// connect to server
oClient.Active := True;
// Subscribe to channel "myTopic"
oSTOMP.Subscribe('id0', 'myTopic');
// Send a message to all subscribers of channel "myTopic"
oSTOMP.Send('myTopic', 'Text message');
// Disconnect from server
oSTOMP.Disconnect;