support xtls-rprx-vision, support reality

This commit is contained in:
yuzuki999
2023-05-22 10:36:10 +08:00
parent 0ebc45e2d2
commit 40edaedb22
13 changed files with 112 additions and 223 deletions

View File

@@ -1,14 +1,14 @@
package limiter
import (
"github.com/Yuzuki616/V2bX/api/panel"
"reflect"
"regexp"
)
func (l *Limiter) CheckDomainRule(destination string) (reject bool) {
// have rule
for i := range l.Rules {
if l.Rules[i].Pattern.MatchString(destination) {
if l.Rules[i].MatchString(destination) {
reject = true
break
}
@@ -26,7 +26,7 @@ func (l *Limiter) CheckProtocolRule(protocol string) (reject bool) {
return
}
func (l *Limiter) UpdateRule(newRuleList []panel.DestinationRule) error {
func (l *Limiter) UpdateRule(newRuleList []*regexp.Regexp) error {
if !reflect.DeepEqual(l.Rules, newRuleList) {
l.Rules = newRuleList
}