inbounds

package
v0.0.0-...-3be1a74 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnHandler

type ConnHandler interface {
	HandleConn(ctx context.Context, conn net.Conn)
}

type FuncConnHandler

type FuncConnHandler func(ctx context.Context, conn net.Conn)

func (FuncConnHandler) HandleConn

func (f FuncConnHandler) HandleConn(ctx context.Context, conn net.Conn)

type FuncPacketHandler

type FuncPacketHandler func(p []byte, remote netip.AddrPort, pw PacketWriter)

func (FuncPacketHandler) HandlePacket

func (f FuncPacketHandler) HandlePacket(p []byte, remote netip.AddrPort, pw PacketWriter)

type Inbound

type Inbound struct {
	Logger   *slog.Logger
	Listener *listener.Listener

	// configurations
	Protocols     meta.ProtocolList
	Address       string
	Port          uint16
	UDPBufferSize int

	// Handler
	PacketHandler    PacketHandler
	PacketHandlerOOb PacketHandlerOOb
	ConnHandler      ConnHandler
	// contains filtered or unexported fields
}

func (*Inbound) Close

func (o *Inbound) Close() error

func (*Inbound) Start

func (o *Inbound) Start(ctx context.Context) error

func (*Inbound) WritePacket

func (o *Inbound) WritePacket(bs []byte, remote netip.AddrPort)

type PacketHandler

type PacketHandler interface {
	HandlePacket(p []byte, remote netip.AddrPort, pw PacketWriter)
}

type PacketHandlerOOb

type PacketHandlerOOb interface {
	HandlePacketOOb(oob []byte, p []byte, remote netip.AddrPort, pw PacketWriter)
}

type PacketWriter

type PacketWriter interface {
	WritePacket(bs []byte, remote netip.AddrPort)
}

Jump to

Keyboard shortcuts

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