From: qydysky Date: Sun, 14 Apr 2024 15:54:02 +0000 (+0000) Subject: 1 X-Git-Tag: v0.28.20240414155905 X-Git-Url: http://127.0.0.1:8081/?a=commitdiff_plain;h=9aa759a2c04e4230f1cc50ac5eddca2e48179325;p=part%2F.git 1 --- diff --git a/Net.go b/Net.go index 107b9b8..276df43 100644 --- a/Net.go +++ b/Net.go @@ -245,11 +245,11 @@ func Forward(targetaddr, listenaddr string, acceptCIDRs []string) (closef func() ip := net.ParseIP(strings.Split(proxyconn.RemoteAddr().String(), ":")[0]) - var deny bool - for i := 0; !deny && i < len(matchfunc); i++ { - deny = deny || !matchfunc[i](ip) + var accept bool + for i := 0; !accept && i < len(matchfunc); i++ { + accept = accept || matchfunc[i](ip) } - if deny { + if !accept { //返回Deny select { default: