Pārlūkot izejas kodu

iplimit: ipRegex improved

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.
mhsanaei 2 mēneši atpakaļ
vecāks
revīzija
ee946ceab2
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      web/job/check_client_ip_job.go

+ 1 - 1
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()