Documentation ¶
Overview ¶
Package portmap implements port mapping using NAT-PMP or uPNP.
Index ¶
Constants ¶
View Source
const ( NATPMP = 1 UPNP = 2 All = NATPMP | UPNP )
Variables ¶
This section is empty.
Functions ¶
func Map ¶
func Map(ctx context.Context, label string, internal uint16, kind int, f func(proto string, status Status, err error)) error
Map runs a portmapping loop for both TCP and UDP. The kind parameter indicates the portmapping protocols to attempt.
The label is passed to the UPNP server (it is not used with NAT-PMP) and may be displayed in the router's user interface.
The callback function is called whenever a mapping is established or changes, or when an error occurs; it may be nil.
Types ¶
Click to show internal directories.
Click to hide internal directories.