mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-06-13 11:59:35 +03:00
API - Add | Remove Routing Rules (#3189)
* add RuleTag to routing rules * add router pb commands * add and remove routing rules api * cleanup * fix * improve error msg * add append flag apply balancer config
This commit is contained in:
@ -11,6 +11,7 @@ import (
|
||||
|
||||
type Rule struct {
|
||||
Tag string
|
||||
RuleTag string
|
||||
Balancer *Balancer
|
||||
Condition Condition
|
||||
}
|
||||
@ -150,7 +151,7 @@ func (br *BalancingRule) Build(ohm outbound.Manager, dispatcher routing.Dispatch
|
||||
leastLoadStrategy := NewLeastLoadStrategy(s)
|
||||
return &Balancer{
|
||||
selectors: br.OutboundSelector,
|
||||
ohm: ohm,
|
||||
ohm: ohm,
|
||||
fallbackTag: br.FallbackTag,
|
||||
strategy: leastLoadStrategy,
|
||||
}, nil
|
||||
@ -159,7 +160,7 @@ func (br *BalancingRule) Build(ohm outbound.Manager, dispatcher routing.Dispatch
|
||||
case "":
|
||||
return &Balancer{
|
||||
selectors: br.OutboundSelector,
|
||||
ohm: ohm,
|
||||
ohm: ohm,
|
||||
fallbackTag: br.FallbackTag,
|
||||
strategy: &RandomStrategy{},
|
||||
}, nil
|
||||
|
Reference in New Issue
Block a user