support protocol rule

This commit is contained in:
Yuzuki616
2023-07-20 21:14:18 +08:00
parent 7cc57fe2ba
commit adf98fbc81
6 changed files with 92 additions and 48 deletions

View File

@@ -3,6 +3,7 @@ package node
import (
"errors"
"fmt"
"github.com/Yuzuki616/V2bX/api/iprecoder"
"github.com/Yuzuki616/V2bX/api/panel"
"github.com/Yuzuki616/V2bX/common/task"
@@ -58,7 +59,7 @@ func (c *Controller) Start() error {
// add limiter
l := limiter.AddLimiter(c.Tag, &c.LimitConfig, c.userList)
// add rule limiter
if err = l.UpdateRule(c.nodeInfo.Rules); err != nil {
if err = l.UpdateRule(&c.nodeInfo.Rules); err != nil {
return fmt.Errorf("update rule error: %s", err)
}
if c.nodeInfo.Tls || c.nodeInfo.Type == "hysteria" {