TsgcWSPServer_WebRTCProperties › WebRTC

WebRTC Property

Signalling configuration: the list of STUN/TURN ICE server URIs pushed to joining peers and the hang-up policy for closed sessions.

Syntax

property WebRTC: TsgcWSWebRTC_Options read FWebRTC write SetWebRTC;

Default Value

IceServers empty, CloseSessionOnHangup = True

Remarks

Container of the two signalling-level options. IceServers is a TStringList of JSON entries (for example {"urls":"stun:stun.l.google.com:19302"} or a turn: entry with credentials); when a client connects, the server pushes an sgc@iceservers frame carrying the list so the browser can feed it directly to RTCPeerConnection. CloseSessionOnHangup decides what happens when a peer sends {"type":"bye"}: when True the channel is torn down and every subscriber is removed; when False the server rewrites the frame as {"type":"remote-close"} and only decrements the subscriber count, so the remaining peer can renegotiate.

Example


WebRTCSrv.WebRTC.IceServers.Add('{"urls":"stun:stun.l.google.com:19302"}');
WebRTCSrv.WebRTC.IceServers.Add(
  '{"urls":"turn:turn.example.com:3478",' +
  '"username":"alice","credential":"s3cret"}');
WebRTCSrv.WebRTC.CloseSessionOnHangup := True;

Back to Properties