udpnat

package
v0.5.0-alpha.12 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: GPL-2.0 Imports: 11 Imported by: 28

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirectBackWriter

type DirectBackWriter struct {
	Source N.PacketConn
	Nat    N.PacketConn
}

func (*DirectBackWriter) Upstream

func (w *DirectBackWriter) Upstream() any

func (*DirectBackWriter) WritePacket

func (w *DirectBackWriter) WritePacket(buffer *buf.Buffer, addr M.Socksaddr) error

type Handler

type Handler interface {
	N.UDPConnectionHandler
	E.Handler
}

type Service

type Service[K comparable] struct {
	// contains filtered or unexported fields
}

func New

func New[K comparable](maxAge int64, handler Handler) *Service[K]

func (*Service[T]) NewContextPacket

func (s *Service[T]) NewContextPacket(ctx context.Context, key T, buffer *buf.Buffer, metadata M.Metadata, init func(natConn N.PacketConn) (context.Context, N.PacketWriter))

func (*Service[T]) NewPacket

func (s *Service[T]) NewPacket(ctx context.Context, key T, buffer *buf.Buffer, metadata M.Metadata, init func(natConn N.PacketConn) N.PacketWriter)

func (*Service[T]) NewPacketDirect

func (s *Service[T]) NewPacketDirect(ctx context.Context, key T, conn N.PacketConn, buffer *buf.Buffer, metadata M.Metadata)

func (*Service[T]) WriteIsThreadUnsafe

func (s *Service[T]) WriteIsThreadUnsafe()

Jump to

Keyboard shortcuts

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