TsgcRTCPeerConnectionEvents › OnRTCWebSocketBeforeConnect

OnRTCWebSocketBeforeConnect Event

Fired before the signalling WebSocket client connects; lets you tweak the client.

Syntax

property OnRTCWebSocketBeforeConnect: TsgcRTCWebSocketBeforeConnectEvent;
// TsgcRTCWebSocketBeforeConnectEvent = procedure(Sender: TObject; const Client: TsgcWSClient) of object

Default Value

Remarks

Raised by GatherCandidates just before the internal TsgcWSClient is activated. Use it to adjust properties that cannot be reached through RTCOptions.WebSocket — for example custom headers, authentication, proxy, TLS options, timeouts or extra events on the underlying client.

Example

procedure TForm1.oRTCWebSocketBeforeConnect(Sender: TObject;
  const Client: TsgcWSClient);
begin
  Client.Authentication.Enabled := True;
  Client.Authentication.Session.Token := 'jwt-token';
end;

Back to Events