mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-05-18 01:58:41 +00:00
Merge e481728362
into 800b8b50cc
This commit is contained in:
commit
12f08ec4af
19 changed files with 791 additions and 140 deletions
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue