mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-21 17:46:58 -05:00
fix strategy selector
This commit is contained in:
parent
fc8d23bcc5
commit
8adb3dc5a6
@ -160,7 +160,7 @@ func (rr *RoutingRule) BuildCondition() (Condition, error) {
|
||||
// Build builds the balancing rule
|
||||
func (br *BalancingRule) Build(ohm outbound.Manager, dispatcher routing.Dispatcher) (*Balancer, error) {
|
||||
switch br.Strategy {
|
||||
case "leastPing":
|
||||
case "leastping":
|
||||
i, err := br.StrategySettings.GetInstance()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -174,7 +174,7 @@ func (br *BalancingRule) Build(ohm outbound.Manager, dispatcher routing.Dispatch
|
||||
strategy: &LeastPingStrategy{config: s},
|
||||
ohm: ohm,
|
||||
}, nil
|
||||
case "leastLoad":
|
||||
case "leastload":
|
||||
i, err := br.StrategySettings.GetInstance()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -191,11 +191,13 @@ func (br *BalancingRule) Build(ohm outbound.Manager, dispatcher routing.Dispatch
|
||||
}, nil
|
||||
case "random":
|
||||
fallthrough
|
||||
default:
|
||||
case "":
|
||||
return &Balancer{
|
||||
selectors: br.OutboundSelector,
|
||||
ohm: ohm, fallbackTag: br.FallbackTag,
|
||||
strategy: &RandomStrategy{},
|
||||
}, nil
|
||||
default:
|
||||
return nil, newError("unrecognized balancer type")
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user