From ee946ceab20def23a4ef2188271a297725ec4909 Mon Sep 17 00:00:00 2001 From: mhsanaei Date: Sun, 5 Jan 2025 18:58:51 +0100 Subject: [PATCH] iplimit: ipRegex improved MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the client has MUX enabled, a TCP or UDP prefix appears before the IP address. We initially weren’t aware of this behavior, but we have now resolved the issue. --- web/job/check_client_ip_job.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/job/check_client_ip_job.go b/web/job/check_client_ip_job.go index 61f8b724..c960268d 100644 --- a/web/job/check_client_ip_job.go +++ b/web/job/check_client_ip_job.go @@ -106,7 +106,7 @@ func (j *CheckClientIpJob) hasLimitIp() bool { func (j *CheckClientIpJob) processLogFile() bool { - ipRegex := regexp.MustCompile(`from \[?([0-9a-fA-F:.]+)\]?:\d+ accepted`) + ipRegex := regexp.MustCompile(`from (?:tcp:|udp:)?\[?([0-9a-fA-F\.:]+)\]?:\d+ accepted`) emailRegex := regexp.MustCompile(`email: (.+)$`) accessLogPath, _ := xray.GetAccessLogPath()