TsgcWSPServer_WebRTC › Properties › WebRTC
Signalling configuration: the list of STUN/TURN ICE server URIs pushed to joining peers and the hang-up policy for closed sessions.
property WebRTC: TsgcWSWebRTC_Options read FWebRTC write SetWebRTC;
IceServers empty, CloseSessionOnHangup = True
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.
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;