udpnat

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: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn interface {
	net.Conn
	net.PacketConn

	SetPacketHandler
}

type Option

type Option struct {
	Size    uint32
	Timeout time.Duration
}

type PacketHandler

type PacketHandler interface {
	NewPacket(packet2 netio.UDPPacket)
}

type PacketHandlerFunc

type PacketHandlerFunc func(p netio.UDPPacket)

func (PacketHandlerFunc) NewPacket

func (o PacketHandlerFunc) NewPacket(p netio.UDPPacket)

type PrepareFunc

type PrepareFunc func(source addrs.Socksaddr, destination addrs.Socksaddr, p netio.UDPPacket) PrepareResult

type PrepareResult

type PrepareResult struct {
	Success bool

	OnClose      func(conn Conn)
	Handler      PacketHandler
	PacketWriter netio.PacketWriter
}

type SetPacketHandler

type SetPacketHandler interface {
	SetHandler(h PacketHandler)
}

type UdpNat

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

func New

func New(prepare PrepareFunc, opt *Option) (*UdpNat, error)

func (*UdpNat) Close

func (u *UdpNat) Close() error

func (*UdpNat) NewPacket

func (u *UdpNat) NewPacket(buffers *buf.Buffer, source addrs.Socksaddr, destination addrs.Socksaddr) (Conn, bool)

Jump to

Keyboard shortcuts

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