Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mapper ¶
type Mapper struct {
// contains filtered or unexported fields
}
Mapper attempts to open a set of ports on a router
func NewPortMapper ¶ added in v0.8.0
NewPortMapper returns an initialized mapper
func (*Mapper) Map ¶ added in v0.8.0
Map a connection from extPort (exposed to the internet) to our intPort (where our process is listening).
func (*Mapper) UnmapAllPorts ¶
func (dev *Mapper) UnmapAllPorts()
UnmapAllPorts stops mapping all ports from this mapper and attempts to unmap them.
type Router ¶
type Router interface { IsNATTraversal() bool MapPort(protocol string, intPort, extPort uint16, desc string, duration time.Duration) error UnmapPort(protocol string, intPort, extPort uint16) error ExternalIP() (net.IP, error) }
Router describes the functionality that a network device must support to be able to open ports to an external IP.
func GetRouter ¶ added in v0.8.0
func GetRouter() Router
GetRouter returns a router on the current network.
func NewNoRouter ¶ added in v0.8.0
func NewNoRouter() Router
NewNoRouter returns a router that assumes the network is public
Click to show internal directories.
Click to hide internal directories.