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:
UUBulb
2024-11-22 22:40:43 +08:00
committed by GitHub
parent d699d0ee87
commit fc98c0919f
16 changed files with 427 additions and 309 deletions

View File

@@ -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 {