mirror of
https://github.com/wyx2685/V2bX.git
synced 2026-02-04 04:30:08 +00:00
change project structure
add across nodes ip limit add user ip recorder del config file watch
This commit is contained in:
24
xray/rule.go
Normal file
24
xray/rule.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package xray
|
||||
|
||||
import (
|
||||
"github.com/Yuzuki616/V2bX/api"
|
||||
"github.com/Yuzuki616/V2bX/app/dispatcher"
|
||||
"github.com/xtls/xray-core/features/routing"
|
||||
)
|
||||
|
||||
func (p *Xray) UpdateRule(tag string, newRuleList []api.DetectRule) error {
|
||||
dispather := p.Server.GetFeature(routing.DispatcherType()).(*dispatcher.DefaultDispatcher)
|
||||
err := dispather.RuleManager.UpdateRule(tag, newRuleList)
|
||||
return err
|
||||
}
|
||||
|
||||
func (p *Xray) UpdateProtocolRule(tag string, newRuleList []string) error {
|
||||
dispather := p.Server.GetFeature(routing.DispatcherType()).(*dispatcher.DefaultDispatcher)
|
||||
err := dispather.RuleManager.UpdateProtocolRule(tag, newRuleList)
|
||||
return err
|
||||
}
|
||||
|
||||
func (p *Xray) GetDetectResult(tag string) (*[]api.DetectResult, error) {
|
||||
dispather := p.Server.GetFeature(routing.DispatcherType()).(*dispatcher.DefaultDispatcher)
|
||||
return dispather.RuleManager.GetDetectResult(tag)
|
||||
}
|
||||
Reference in New Issue
Block a user