mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-03-23 11:31:51 +00:00
report geoip separately, fix server creation & deletion bugs (#14)
* new geoip method * report geoip separately, fix server creation & deletion bugs * fix struct tag * fix write name * remove deleteion list * remove rpc realip header * Revert "remove rpc realip header" This reverts commit 8a5f86cf2d7df87f28cfa2a3b3430f449dd6ed73.
This commit is contained in:
@@ -193,7 +193,7 @@ func (ns *NotificationServerBundle) replaceParamsInString(str string, message st
|
||||
str = strings.ReplaceAll(str, "#SERVER.UDPCONNCOUNT#", mod(fmt.Sprintf("%d", ns.Server.State.UdpConnCount)))
|
||||
|
||||
var ipv4, ipv6, validIP string
|
||||
ipList := strings.Split(ns.Server.Host.IP, "/")
|
||||
ipList := strings.Split(ns.Server.GeoIP.IP.Join(), "/")
|
||||
if len(ipList) > 1 {
|
||||
// 双栈
|
||||
ipv4 = ipList[0]
|
||||
@@ -201,7 +201,7 @@ func (ns *NotificationServerBundle) replaceParamsInString(str string, message st
|
||||
validIP = ipv4
|
||||
} else if len(ipList) == 1 {
|
||||
// 仅ipv4|ipv6
|
||||
if strings.Contains(ipList[0], ":") {
|
||||
if strings.IndexByte(ipList[0], ':') != -1 {
|
||||
ipv6 = ipList[0]
|
||||
validIP = ipv6
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user