Fix external IP discovery. fix LeaveRequest during server disconnect (#72)

This commit is contained in:
David Zhao
2021-07-28 21:33:34 -07:00
committed by GitHub
parent 6fca5647fd
commit a9c4851113
2 changed files with 7 additions and 3 deletions
+5 -1
View File
@@ -13,7 +13,11 @@ import (
func (conf *Config) determineIP() (string, error) {
if conf.RTC.UseExternalIP {
ip, err := GetExternalIP(conf.RTC.StunServers)
stunServers := conf.RTC.StunServers
if len(stunServers) == 0 {
stunServers = DEFAULT_STUN_SERVERS
}
ip, err := GetExternalIP(stunServers)
if err == nil {
return ip, nil
} else {