listener

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: LGPL-2.1 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListenTCP

func ListenTCP(ctx context.Context, address string, port uint16, opt Options) (net.Listener, error)

func ListenTCPSerial

func ListenTCPSerial(ctx context.Context, lc net.ListenConfig, network meta.Network, address []addrs.Socksaddr, enableTFO bool) (net.Listener, error)

func ListenUDP

func ListenUDP(ctx context.Context, address string, port uint16, opt Options) (*net.UDPConn, error)

func ListenUDPSerial

func ListenUDPSerial(ctx context.Context, lc net.ListenConfig, network meta.Network, address []addrs.Socksaddr) (*net.UDPConn, error)

Types

type Listener

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

func NewListener

func NewListener(options Options) *Listener

func (*Listener) ListenTCP

func (l *Listener) ListenTCP(ctx context.Context, address string, port uint16) (net.Listener, error)

func (*Listener) ListenUDP

func (l *Listener) ListenUDP(ctx context.Context, address string, port uint16) (*net.UDPConn, error)

type Options

type Options struct {
	// optional
	Family    string
	Interface string
	ReuseAddr bool
	ReusePort bool

	// tcp
	KeepAlive net.KeepAliveConfig
	TFO       bool
	MPTCP     bool

	// udp
	UDPFragment bool
}

Jump to

Keyboard shortcuts

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