igdp

package
v0.0.0-...-5d64378 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2017 License: BSD-3-Clause Imports: 9 Imported by: 1

README

Internet Gateway Device Protocol

Largely based on https://github.com/prestonTao/upnp and with many references to http://www.upnp-hacks.org/.

GoDoc

Documentation

Overview

Package igdp implements then Internet Gateway Device Protocol to handle communication with a uPNP device to open an external port for NAT Traversal.

Index

Constants

View Source
const ErrNoLocalIP = errors.String("No local IP")

ErrNoLocalIP error will occure when a local IP cannot be determined

Variables

View Source
var Control string

Control protocol to use in requests

View Source
var ControlURL string

ControlURL is the url on URLBase to send requests

View Source
var ExternalIP string

ExternalIP that the uPNP device presents to the rest of the internet. Populated by calling GetExternalIP

View Source
var LocalIP string

LocalIP address

View Source
var Location string

Location to request device description

View Source
var URLBase string

URLBase IP and port for communication with uPNP device

Functions

func AddPortMapping

func AddPortMapping(localPort, remotePort rnet.Port) (string, error)

AddPortMapping maps a local port to a port on the ExternalIP.

func GetExternalIP

func GetExternalIP() (string, error)

GetExternalIP will populate ExternalIP. The value is also returned, along with an error.

func Setup

func Setup() error

Setup will populate LocalIP, URLBase, ControlURL, Control and Location. It must be called prior to calling any other functions in this package.

Types

This section is empty.

Jump to

Keyboard shortcuts

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