This commit is contained in:
withchao
2023-03-17 11:14:14 +08:00
parent 15610438d8
commit 835cd6d14a
22 changed files with 5 additions and 5 deletions
+26
View File
@@ -0,0 +1,26 @@
package network
import (
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant"
utils "github.com/OpenIMSDK/open_utils"
)
func GetRpcRegisterIP(configIP string) (string, error) {
registerIP := configIP
if registerIP == "" {
ip, err := utils.GetLocalIP()
if err != nil {
return "", err
}
registerIP = ip
}
return registerIP, nil
}
func GetListenIP(configIP string) string {
if configIP == "" {
return constant.LocalHost
} else {
return configIP
}
}