Add Public IP Service handling to config and GetPublicIP().

This commit is contained in:
cameronts
2022-07-27 16:45:12 -07:00
parent 2585e88d79
commit 1cb42e8f8b
5 changed files with 27 additions and 4 deletions

View File

@@ -85,7 +85,7 @@ func JoinNetwork(cfg *config.ClientConfig, privateKey string) error {
if cfg.Node.IsLocal == "yes" && cfg.Node.LocalAddress != "" {
cfg.Node.Endpoint = cfg.Node.LocalAddress
} else {
cfg.Node.Endpoint, err = ncutils.GetPublicIP()
cfg.Node.Endpoint, err = ncutils.GetPublicIP(cfg.GlobalSettings.PublicIPService)
}
if err != nil || cfg.Node.Endpoint == "" {
logger.Log(0, "network:", cfg.Network, "error setting cfg.Node.Endpoint.")