mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 01:08:33 +00:00
Add observatory / latestPing balancing strategy
Co-authored-by: Shelikhoo <xiaokangwang@outlook.com>
This commit is contained in:
parent
77d0419aca
commit
5c366db847
21 changed files with 1127 additions and 31 deletions
7
features/extension/contextreceiver.go
Normal file
7
features/extension/contextreceiver.go
Normal file
|
@ -0,0 +1,7 @@
|
|||
package extension
|
||||
|
||||
import "context"
|
||||
|
||||
type ContextReceiver interface {
|
||||
InjectContext(ctx context.Context)
|
||||
}
|
19
features/extension/observatory.go
Normal file
19
features/extension/observatory.go
Normal file
|
@ -0,0 +1,19 @@
|
|||
package extension
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
|
||||
"github.com/xtls/xray-core/features"
|
||||
)
|
||||
|
||||
type Observatory interface {
|
||||
features.Feature
|
||||
|
||||
GetObservation(ctx context.Context) (proto.Message, error)
|
||||
}
|
||||
|
||||
func ObservatoryType() interface{} {
|
||||
return (*Observatory)(nil)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue