From eabecb99ac7ee104386e23ea068c3bc22ae5a74a Mon Sep 17 00:00:00 2001 From: maxb Date: Tue, 20 Sep 2022 23:43:07 -0700 Subject: [PATCH] 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. --- pkg/rtc/config.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/rtc/config.go b/pkg/rtc/config.go index 0126715d1..06dee1578 100644 --- a/pkg/rtc/config.go +++ b/pkg/rtc/config.go @@ -189,10 +189,11 @@ func NewWebRTCConfig(conf *config.Config, externalIP string) (*WebRTCConfig, err if rtcConf.UseICELite { s.SetLite(true) - } else if !rtcConf.UseExternalIP { + } else if rtcConf.NodeIP == "" && !rtcConf.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 + // Do not automatically add STUN servers if nodeIP is set if len(rtcConf.STUNServers) > 0 { c.ICEServers = []webrtc.ICEServer{iceServerForStunServers(rtcConf.STUNServers)} } else {