Skip to content

Commit ee946ce

Browse files
committed
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.
1 parent b650064 commit ee946ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

web/job/check_client_ip_job.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func (j *CheckClientIpJob) hasLimitIp() bool {
106106

107107
func (j *CheckClientIpJob) processLogFile() bool {
108108

109-
ipRegex := regexp.MustCompile(`from \[?([0-9a-fA-F:.]+)\]?:\d+ accepted`)
109+
ipRegex := regexp.MustCompile(`from (?:tcp:|udp:)?\[?([0-9a-fA-F\.:]+)\]?:\d+ accepted`)
110110
emailRegex := regexp.MustCompile(`email: (.+)$`)
111111

112112
accessLogPath, _ := xray.GetAccessLogPath()

0 commit comments

Comments
 (0)