API: Add ListInbounds and ListOutbounds (#4723)

This commit is contained in:
Sergey Gorbunov 2025-06-06 04:51:48 +03:00 committed by GitHub
parent d44c78b819
commit af7a76da67
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 791 additions and 140 deletions

View file

@ -4,6 +4,7 @@ import (
"context"
"github.com/xtls/xray-core/common"
"github.com/xtls/xray-core/common/serial"
"github.com/xtls/xray-core/features"
"github.com/xtls/xray-core/transport"
)
@ -15,6 +16,8 @@ type Handler interface {
common.Runnable
Tag() string
Dispatch(ctx context.Context, link *transport.Link)
SenderSettings() *serial.TypedMessage
ProxySettings() *serial.TypedMessage
}
type HandlerSelector interface {
@ -35,6 +38,9 @@ type Manager interface {
// RemoveHandler removes a handler from outbound.Manager.
RemoveHandler(ctx context.Context, tag string) error
// ListHandlers returns a list of outbound.Handler.
ListHandlers(ctx context.Context) []Handler
}
// ManagerType returns the type of Manager interface. Can be used to implement common.HasType.