mirror of
https://github.com/ehang-io/nps.git
synced 2025-09-02 11:56:53 +00:00
Ip限制 npc代理连接
This commit is contained in:
@@ -11,6 +11,7 @@ const (
|
||||
WORK_MAIN = "main"
|
||||
WORK_CHAN = "chan"
|
||||
WORK_CONFIG = "conf"
|
||||
WORK_REGISTER = "rgst"
|
||||
WORK_STATUS = "stus"
|
||||
RES_SIGN = "sign"
|
||||
RES_MSG = "msg0"
|
||||
|
@@ -59,7 +59,7 @@ func GetLogPath() string {
|
||||
func GetTmpPath() string {
|
||||
var path string
|
||||
if IsWindows() {
|
||||
path = "./"
|
||||
path = GetRunPath()
|
||||
} else {
|
||||
path = "/tmp"
|
||||
}
|
||||
|
@@ -241,3 +241,8 @@ func FormatAddress(s string) string {
|
||||
}
|
||||
return "127.0.0.1:" + s
|
||||
}
|
||||
|
||||
func GetIpByAddr(addr string) string {
|
||||
arr := strings.Split(addr, ":")
|
||||
return arr[0]
|
||||
}
|
||||
|
Reference in New Issue
Block a user