diff --git a/configs/config.yaml b/configs/config.yaml index e34c58ef..bf8b4fdb 100644 --- a/configs/config.yaml +++ b/configs/config.yaml @@ -262,6 +262,10 @@ webrtc: # a list of STUN/TURN servers to use iceServers: - url: stun:stun.l.google.com:19302 + # configures whether the ice agent should be a lite agent (true/false) + # (performance) + # don't use iceServers when enabled + iceLite: false # ICE configuration # by default, ICE ports are random and unlimited # alternatives: diff --git a/pkg/config/webrtc/config.go b/pkg/config/webrtc/config.go index 292542af..5b7bb3af 100644 --- a/pkg/config/webrtc/config.go +++ b/pkg/config/webrtc/config.go @@ -11,6 +11,7 @@ type Webrtc struct { Max uint16 } IceIpMap string + IceLite bool SinglePort int } diff --git a/pkg/webrtc/connection.go b/pkg/webrtc/connection.go index 9e15bfb5..40a1ec58 100644 --- a/pkg/webrtc/connection.go +++ b/pkg/webrtc/connection.go @@ -42,6 +42,9 @@ func DefaultPeerConnection(conf conf.Webrtc) (*PeerConnection, error) { panic(err) } } + if conf.IceLite { + settingEngine.SetLite(conf.IceLite) + } if conf.IcePorts.Min > 0 && conf.IcePorts.Max > 0 { if err := settingEngine.SetEphemeralUDPPortRange(conf.IcePorts.Min, conf.IcePorts.Max); err != nil { panic(err)