outbound

package
v1.11.0-alpha.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2024 License: GPL-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyEarlyConn

func CopyEarlyConn(ctx context.Context, conn net.Conn, serverConn net.Conn) error

func NewConnection

func NewConnection(ctx context.Context, this N.Dialer, conn net.Conn, metadata adapter.InboundContext) error

func NewDirectConnection

func NewDirectConnection(ctx context.Context, router adapter.Router, this N.Dialer, conn net.Conn, metadata adapter.InboundContext, domainStrategy dns.DomainStrategy) error

func NewDirectPacketConnection

func NewDirectPacketConnection(ctx context.Context, router adapter.Router, this N.Dialer, conn N.PacketConn, metadata adapter.InboundContext, domainStrategy dns.DomainStrategy) error

func NewPacketConnection

func NewPacketConnection(ctx context.Context, this N.Dialer, conn N.PacketConn, metadata adapter.InboundContext) error

func Register

func Register[Options any](registry *Registry, outboundType string, constructor ConstructorFunc[Options])

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

func NewAdapter

func NewAdapter(protocol string, network []string, tag string, dependencies []string) Adapter

func NewAdapterWithDialerOptions

func NewAdapterWithDialerOptions(protocol string, network []string, tag string, dialOptions option.DialerOptions) Adapter

func (*Adapter) Dependencies

func (a *Adapter) Dependencies() []string

func (*Adapter) Network

func (a *Adapter) Network() []string

func (*Adapter) Tag

func (a *Adapter) Tag() string

func (*Adapter) Type

func (a *Adapter) Type() string

type ConstructorFunc

type ConstructorFunc[T any] func(ctx context.Context, router adapter.Router, logger log.ContextLogger, tag string, options T) (adapter.Outbound, error)

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(logger logger.ContextLogger, registry adapter.OutboundRegistry, defaultTag string) *Manager

func (*Manager) Close

func (m *Manager) Close() error

func (*Manager) Create

func (m *Manager) Create(ctx context.Context, router adapter.Router, logger log.ContextLogger, tag string, inboundType string, options any) error

func (*Manager) Default

func (m *Manager) Default() adapter.Outbound

func (*Manager) Initialize

func (m *Manager) Initialize(defaultOutboundFallback adapter.Outbound)

func (*Manager) Outbound

func (m *Manager) Outbound(tag string) (adapter.Outbound, bool)

func (*Manager) Outbounds

func (m *Manager) Outbounds() []adapter.Outbound

func (*Manager) Remove

func (m *Manager) Remove(tag string) error

func (*Manager) Start

func (m *Manager) Start(stage adapter.StartStage) error

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

func NewRegistry

func NewRegistry() *Registry

func (*Registry) CreateOptions

func (r *Registry) CreateOptions(outboundType string) (any, bool)

func (*Registry) CreateOutbound

func (r *Registry) CreateOutbound(ctx context.Context, router adapter.Router, logger log.ContextLogger, tag string, outboundType string, options any) (adapter.Outbound, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL