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.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.