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 {
|
if rtcConf.UseICELite {
|
||||||
s.SetLite(true)
|
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 {
|
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{
|
return &WebRTCConfig{
|
||||||
Configuration: c,
|
Configuration: c,
|
||||||
SettingEngine: s,
|
SettingEngine: s,
|
||||||
|
|||||||
Reference in New Issue
Block a user