package portmapper
Import Path
github.com/tmc/go-iroh/internal/portmapper (on go.dev)
Dependency Relation
imports 7 packages, and imported by one package
Involved Source Files
Package portmapper is a minimal NAT-PMP (RFC 6886) client for requesting a
UDP port mapping from a home gateway.
Package-Level Type Names (total 2)
Mapping is a UDP port mapping returned by a gateway.
ExternalAddr netip.AddrPort
Lifetime time.Duration
func NATPMPClient.MapUDP(ctx context.Context, internalPort uint16, suggestedExternalPort uint16, lifetime time.Duration) (Mapping, error)
NATPMPClient is a minimal NAT-PMP client.
Gateway netip.Addr
Port uint16
Timeout time.Duration
ExternalIPv4 returns the public IPv4 address reported by the gateway.
MapUDP maps internalPort through the NAT-PMP gateway, requesting the given
lifetime. A lifetime of 0 deletes the mapping (RFC 6886 ยง3.4): the gateway
removes any mapping for internalPort and returns a zero Mapping.
![]() |
The pages are generated with Golds v0.8.4. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |