natmap

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package natmap provides optional NAT helpers (Phase 2b: UPnP IGD port mapping). TURN and other relays are out of scope until Phase 3+.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LocalIPv4ForUPnP

func LocalIPv4ForUPnP() string

LocalIPv4ForUPnP returns an IPv4 address suitable as IGD "internal client" (typically the LAN address used for outbound UDP).

func MapUDPPort

func MapUDPPort(ctx context.Context, internalPort int, internalClient string) (externalIP string, externalPort int, cleanup func(), err error)

MapUDPPort asks the LAN IGD to forward UDP externalPort -> internalClient:internalPort using the same port number on the WAN side (required for predictable QUIC URLs). Returns cleanup (DeletePortMapping). Errors if no gateway or mapping is rejected.

func QUICURL

func QUICURL(host string, port int) string

QUICURL builds a quic:// URL for an endpoint string (host + port).

Types

This section is empty.

Jump to

Keyboard shortcuts

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