mirror of
https://github.com/wyx2685/V2bX.git
synced 2026-02-04 12:40:11 +00:00
update to v1.1.0
change to uniproxy api refactor build inbound refactor limiter and rule add ss2022 support add speedlimit support and more...
This commit is contained in:
@@ -16,7 +16,7 @@ func NewRule() *Rule {
|
||||
}
|
||||
}
|
||||
|
||||
func (r *Rule) UpdateRule(tag string, newRuleList *panel.DetectRule) error {
|
||||
func (r *Rule) UpdateRule(tag string, newRuleList []panel.DestinationRule) error {
|
||||
if value, ok := r.Rule.LoadOrStore(tag, newRuleList); ok {
|
||||
oldRuleList := value.([]panel.DestinationRule)
|
||||
if !reflect.DeepEqual(oldRuleList, newRuleList) {
|
||||
@@ -30,20 +30,13 @@ func (r *Rule) Detect(tag string, destination string, protocol string) (reject b
|
||||
reject = false
|
||||
// If we have some rule for this inbound
|
||||
if value, ok := r.Rule.Load(tag); ok {
|
||||
ruleList := value.(*panel.DetectRule)
|
||||
for i, _ := range ruleList.DestinationRule {
|
||||
if ruleList.DestinationRule[i].Pattern.Match([]byte(destination)) {
|
||||
ruleList := value.([]panel.DestinationRule)
|
||||
for i := range ruleList {
|
||||
if ruleList[i].Pattern.Match([]byte(destination)) {
|
||||
reject = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !reject {
|
||||
for _, v := range ruleList.ProtocolRule {
|
||||
if v == protocol {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return reject
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user