Documentation
¶
Overview ¶
Package portmapper is a minimal NAT-PMP (RFC 6886) client for requesting a UDP port mapping from a home gateway.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NATPMPClient ¶
NATPMPClient is a minimal NAT-PMP client.
func (NATPMPClient) ExternalIPv4 ¶
ExternalIPv4 returns the public IPv4 address reported by the gateway.
func (NATPMPClient) MapUDP ¶
func (c NATPMPClient) MapUDP(ctx context.Context, internalPort uint16, suggestedExternalPort uint16, lifetime time.Duration) (Mapping, error)
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.
Click to show internal directories.
Click to hide internal directories.