Don't automatically add STUN servers if nodeIP set (#1023)
It's my understanding that the nodeIP config can be set to ensure that a specific IP is provided for the host candidate. The code being changed here was added as a convenience so that: | By giving it STUN servers, it should be | connectable even without passing in --node-ip explicitly We'd prefer to be able to specify a nodeIP and then as a side effect have a STUN server added.
This commit is contained in:
+2
-1
@@ -189,10 +189,11 @@ func NewWebRTCConfig(conf *config.Config, externalIP string) (*WebRTCConfig, err
|
|||||||
|
|
||||||
if rtcConf.UseICELite {
|
if rtcConf.UseICELite {
|
||||||
s.SetLite(true)
|
s.SetLite(true)
|
||||||
} else if !rtcConf.UseExternalIP {
|
} else if rtcConf.NodeIP == "" && !rtcConf.UseExternalIP {
|
||||||
// use STUN servers for server to support NAT
|
// use STUN servers for server to support NAT
|
||||||
// when deployed in production, we expect UseExternalIP to be used, and ports accessible
|
// when deployed in production, we expect UseExternalIP to be used, and ports accessible
|
||||||
// this is not compatible with ICE Lite
|
// this is not compatible with ICE Lite
|
||||||
|
// Do not automatically add STUN servers if nodeIP is set
|
||||||
if len(rtcConf.STUNServers) > 0 {
|
if len(rtcConf.STUNServers) > 0 {
|
||||||
c.ICEServers = []webrtc.ICEServer{iceServerForStunServers(rtcConf.STUNServers)}
|
c.ICEServers = []webrtc.ICEServer{iceServerForStunServers(rtcConf.STUNServers)}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user