TsgcRTCPeerConnectionProperties › RTCOptions

RTCOptions Property

Connection options: STUN/TURN server, signalling WebSocket endpoint and DTLS encryption settings.

Syntax

property RTCOptions: TsgcRTCPeerConnection_Options read FRTCOptions write SetRTCOptions;

Default Value

Remarks

Groups every runtime parameter needed to establish a WebRTC peer-to-peer data channel. The sub-options cover the three transport layers used by the component:

Assign these options before calling GatherCandidates.

Example

oRTC := TsgcRTCPeerConnection.Create(nil);

// ... signalling WebSocket
oRTC.RTCOptions.WebSocket.Host := 'signal.server.com';
oRTC.RTCOptions.WebSocket.Port := 443;
oRTC.RTCOptions.WebSocket.Channel := '/room-1';
oRTC.RTCOptions.WebSocket.TLS := True;

// ... STUN/TURN
oRTC.RTCOptions.ICE.Host := 'turn.server.com';
oRTC.RTCOptions.ICE.Port := 3478;
oRTC.RTCOptions.ICE.Username := 'user';
oRTC.RTCOptions.ICE.Password := 'pass';

// ... DTLS
oRTC.RTCOptions.DTLS := True;
oRTC.RTCOptions.DTLSOptions.CertFile := 'peer.crt';
oRTC.RTCOptions.DTLSOptions.KeyFile := 'peer.key';

oRTC.GatherCandidates;

Back to Properties