nat

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GatewayIPResolver

type GatewayIPResolver func(context.Context, net.IP) (net.IP, error)

func GatewayIPNet24Resolver

func GatewayIPNet24Resolver() GatewayIPResolver

func GatewayIPSystemResolver

func GatewayIPSystemResolver() GatewayIPResolver

type Local

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

func NewLocal

func NewLocal(localPort uint16, logger *slog.Logger) *Local

func (*Local) Get

func (s *Local) Get() []netip.AddrPort

func (*Local) Listen

func (s *Local) Listen(ctx context.Context, fn func([]netip.AddrPort) error) error

type LocalIPResolver

type LocalIPResolver func(context.Context) (net.IP, error)

func LocalIPDialResolver

func LocalIPDialResolver(addr string) LocalIPResolver

func LocalIPSystemResolver

func LocalIPSystemResolver() LocalIPResolver

type PMP

type PMP struct {
	PMPConfig
	// contains filtered or unexported fields
}

func NewPMP

func NewPMP(cfg PMPConfig, transport *quic.Transport, localPort uint16, logger *slog.Logger) *PMP

func (*PMP) Get

func (s *PMP) Get() []netip.AddrPort

func (*PMP) Listen

func (s *PMP) Listen(ctx context.Context, fn func([]netip.AddrPort) error) error

func (*PMP) Run

func (s *PMP) Run(ctx context.Context) error

type PMPConfig

type PMPConfig struct {
	Disabled        bool
	LocalResolver   LocalIPResolver
	GatewayResolver GatewayIPResolver
}

Jump to

Keyboard shortcuts

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