mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-04 09:05:59 +08:00
pkg
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user