mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
27 lines
478 B
Go
27 lines
478 B
Go
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
|
|
}
|
|
}
|