1
0
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:
Shelikhoo 2021-06-19 12:35:46 +01:00
parent 22f6b100ba
commit fc8d23bcc5
No known key found for this signature in database
GPG Key ID: C4D5E79D22B25316

View File

@ -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":