mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-06 01:55:58 +08:00
errcode
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"Open_IM/pkg/common/config"
|
||||
"errors"
|
||||
"net"
|
||||
)
|
||||
@@ -23,3 +24,15 @@ func GetLocalIP() (string, error) {
|
||||
|
||||
return "", errors.New("no ip")
|
||||
}
|
||||
|
||||
func GetRpcIP() (string, error) {
|
||||
registerIP := config.Config.RpcRegisterIP
|
||||
if registerIP == "" {
|
||||
ip, err := GetLocalIP()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
registerIP = ip
|
||||
}
|
||||
return registerIP, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user