upnp

package
v0.0.0-...-a838072 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2019 License: Unlicense, ISC Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NAT

type NAT interface {
	// Get the external address from outside the NAT.
	GetExternalAddress() (addr net.IP, err error)
	// Add a port mapping for protocol (
	// "udp" or "tcp") from external port to internal port with description
	// lasting for timeout.
	AddPortMapping(protocol string, externalPort, internalPort int,
		description string, timeout int) (mappedExternalPort int, err error)
	// Remove a previously added port mapping from external port to internal
	// port.
	DeletePortMapping(protocol string, externalPort,
		internalPort int) (err error)
}

NAT is an interface representing a NAT traversal options for example UPNP or NAT-PMP. It provides methods to query and manipulate this traversal to allow access to services.

func Discover

func Discover() (nat NAT, err error)

Discover searches the local network for a UPnP router returning a NAT for the network if so, nil if not.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL