direct

package
v1.14.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: GPL-2.0 Imports: 26 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInbound

func NewInbound(ctx context.Context, router adapter.Router, logger log.ContextLogger, tag string, options option.DirectInboundOptions) (adapter.Inbound, error)

func NewOutbound

func NewOutbound(ctx context.Context, router adapter.Router, logger log.ContextLogger, tag string, options option.DirectOutboundOptions) (adapter.Outbound, error)

func RegisterInbound

func RegisterInbound(registry *inbound.Registry)

func RegisterOutbound

func RegisterOutbound(registry *outbound.Registry)

Types

type Inbound

type Inbound struct {
	inbound.Adapter
	// contains filtered or unexported fields
}

func (*Inbound) Close

func (i *Inbound) Close() error

func (*Inbound) InterfaceUpdated

func (i *Inbound) InterfaceUpdated()

func (*Inbound) NewConnection

func (i *Inbound) NewConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext, onClose N.CloseHandlerFunc)

func (*Inbound) NewPacket

func (i *Inbound) NewPacket(buffer *buf.Buffer, source M.Socksaddr)

func (*Inbound) NewPacketBatch

func (i *Inbound) NewPacketBatch(buffers []*buf.Buffer, sources []M.Socksaddr)

func (*Inbound) NewPacketConnectionEx

func (i *Inbound) NewPacketConnectionEx(ctx context.Context, conn N.PacketConn, source M.Socksaddr, destination M.Socksaddr, onClose N.CloseHandlerFunc)

func (*Inbound) Start

func (i *Inbound) Start(stage adapter.StartStage) error

type Outbound

type Outbound struct {
	outbound.Adapter
	// contains filtered or unexported fields
}

func (*Outbound) AttachReturn

func (h *Outbound) AttachReturn(returnPath tun.Return) error

func (*Outbound) Close added in v1.13.20

func (h *Outbound) Close() error

func (*Outbound) DetachReturn

func (h *Outbound) DetachReturn(returnPath tun.Return) error

func (*Outbound) DialContext

func (h *Outbound) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error)

func (*Outbound) DialParallel

func (h *Outbound) DialParallel(ctx context.Context, network string, destination M.Socksaddr, destinationAddresses []netip.Addr) (net.Conn, error)

func (*Outbound) DialParallelNetwork

func (h *Outbound) DialParallelNetwork(ctx context.Context, network string, destination M.Socksaddr, destinationAddresses []netip.Addr, networkStrategy *C.NetworkStrategy, networkType []C.InterfaceType, fallbackNetworkType []C.InterfaceType, fallbackDelay time.Duration) (net.Conn, error)

func (*Outbound) InterfaceUpdated

func (h *Outbound) InterfaceUpdated()

func (*Outbound) IsEmpty added in v1.11.10

func (h *Outbound) IsEmpty() bool

func (*Outbound) ListenPacket

func (h *Outbound) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error)

func (*Outbound) ListenSerialNetworkPacket

func (h *Outbound) ListenSerialNetworkPacket(ctx context.Context, destination M.Socksaddr, destinationAddresses []netip.Addr, networkStrategy *C.NetworkStrategy, networkType []C.InterfaceType, fallbackNetworkType []C.InterfaceType, fallbackDelay time.Duration) (net.PacketConn, netip.Addr, error)

func (*Outbound) PortAddresses

func (h *Outbound) PortAddresses() (netip.Addr, netip.Addr)

func (*Outbound) PortMTU

func (h *Outbound) PortMTU() uint32

func (*Outbound) PreMatchFlow

func (h *Outbound) PreMatchFlow(network string, destination netip.Addr) adapter.PreMatchAction

func (*Outbound) Start added in v1.13.13

func (h *Outbound) Start(stage adapter.StartStage) error

func (*Outbound) WritePackets

func (h *Outbound) WritePackets(packets [][]byte) error

Jump to

Keyboard shortcuts

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