mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-06-14 20:39:36 +03:00
Add observatory / latestPing balancing strategy
Co-authored-by: Shelikhoo <xiaokangwang@outlook.com>
This commit is contained in:
@ -1,7 +1,10 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/xtls/xray-core/common/dice"
|
||||
"github.com/xtls/xray-core/features/extension"
|
||||
"github.com/xtls/xray-core/features/outbound"
|
||||
)
|
||||
|
||||
@ -41,3 +44,8 @@ func (b *Balancer) PickOutbound() (string, error) {
|
||||
}
|
||||
return tag, nil
|
||||
}
|
||||
func (b *Balancer) InjectContext(ctx context.Context) {
|
||||
if contextReceiver, ok := b.strategy.(extension.ContextReceiver); ok {
|
||||
contextReceiver.InjectContext(ctx)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user