nat

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package nat implements NAT handling facilities

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetMapping

func SetMapping(ctx context.Context, nat NAT, protocol string, extport, intport int, name string) error

SetMapping adds a port mapping on m and keeps it alive until c is closed.

Types

type NAT

type NAT interface {

	// GetExternalAddress returns the external address of the gateway device.
	GetExternalAddress() (addr net.IP, err error)
	// contains filtered or unexported methods
}

NAT represents an interface for upnp and natpmp

func DiscoverGateway

func DiscoverGateway() (NAT, error)

DiscoverGateway attempts to find a gateway device.

Jump to

Keyboard shortcuts

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