Skip to content

Commit

Permalink
iplimit: ipRegex improved
Browse files Browse the repository at this point in the history
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 committed Jan 5, 2025
1 parent b650064 commit ee946ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/job/check_client_ip_job.go
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit ee946ce

Please sign in to comment.