mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-17 23:06:30 -05:00
added apply least ping strategy
This commit is contained in:
parent
22f6b100ba
commit
fc8d23bcc5
@ -161,9 +161,17 @@ func (rr *RoutingRule) BuildCondition() (Condition, error) {
|
||||
func (br *BalancingRule) Build(ohm outbound.Manager, dispatcher routing.Dispatcher) (*Balancer, error) {
|
||||
switch br.Strategy {
|
||||
case "leastPing":
|
||||
i, err := br.StrategySettings.GetInstance()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
s, ok := i.(*StrategyLeastPingConfig)
|
||||
if !ok {
|
||||
return nil, newError("not a StrategyLeastPingConfig").AtError()
|
||||
}
|
||||
return &Balancer{
|
||||
selectors: br.OutboundSelector,
|
||||
strategy: &LeastPingStrategy{},
|
||||
strategy: &LeastPingStrategy{config: s},
|
||||
ohm: ohm,
|
||||
}, nil
|
||||
case "leastLoad":
|
||||
|
Loading…
Reference in New Issue
Block a user