0
mirror of https://github.com/XTLS/Xray-core.git synced 2025-06-16 05:17:16 +03:00

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
19 changed files with 791 additions and 140 deletions

View File

@ -5,6 +5,7 @@ import (
"github.com/xtls/xray-core/common"
"github.com/xtls/xray-core/common/net"
"github.com/xtls/xray-core/common/serial"
"github.com/xtls/xray-core/features"
)
@ -15,6 +16,10 @@ type Handler interface {
common.Runnable
// The tag of this handler.
Tag() string
// Returns the active receiver settings.
ReceiverSettings() *serial.TypedMessage
// Returns the active proxy settings.
ProxySettings() *serial.TypedMessage
// Deprecated: Do not use in new code.
GetRandomInboundProxy() (interface{}, net.Port, int)
@ -32,6 +37,9 @@ type Manager interface {
// RemoveHandler removes a handler from Manager.
RemoveHandler(ctx context.Context, tag string) error
// ListHandlers returns a list of inbound.Handler.
ListHandlers(ctx context.Context) []Handler
}
// ManagerType returns the type of Manager interface. Can be used for implementing common.HasType.