mirror of
https://github.com/livekit/livekit.git
synced 2026-08-28 20:38:20 +00:00
Do not pass STUN servers when using ICE Lite (#634)
This commit is contained in:
+9
-10
@@ -178,6 +178,15 @@ func NewWebRTCConfig(conf *config.Config, externalIP string) (*WebRTCConfig, err
|
||||
|
||||
if rtcConf.UseICELite {
|
||||
s.SetLite(true)
|
||||
} else if !conf.RTC.UseExternalIP {
|
||||
// use STUN servers for server to support NAT
|
||||
// when deployed in production, we expect UseExternalIP to be used, and ports accessible
|
||||
// this is not compatible with ICE Lite
|
||||
if len(conf.RTC.STUNServers) > 0 {
|
||||
c.ICEServers = []webrtc.ICEServer{iceServerForStunServers(conf.RTC.STUNServers)}
|
||||
} else {
|
||||
c.ICEServers = []webrtc.ICEServer{iceServerForStunServers(config.DefaultStunServers)}
|
||||
}
|
||||
}
|
||||
|
||||
if len(rtcConf.Interfaces.Includes) != 0 || len(rtcConf.Interfaces.Excludes) != 0 {
|
||||
@@ -206,16 +215,6 @@ func NewWebRTCConfig(conf *config.Config, externalIP string) (*WebRTCConfig, err
|
||||
})
|
||||
}
|
||||
|
||||
// use STUN servers for server to support NAT
|
||||
// when deployed in production, we expect UseExternalIP to be used, and ports accessible
|
||||
if !conf.RTC.UseExternalIP {
|
||||
if len(conf.RTC.STUNServers) > 0 {
|
||||
c.ICEServers = []webrtc.ICEServer{iceServerForStunServers(conf.RTC.STUNServers)}
|
||||
} else {
|
||||
c.ICEServers = []webrtc.ICEServer{iceServerForStunServers(config.DefaultStunServers)}
|
||||
}
|
||||
}
|
||||
|
||||
return &WebRTCConfig{
|
||||
Configuration: c,
|
||||
SettingEngine: s,
|
||||
|
||||
Reference in New Issue
Block a user