Official Go implementation of the Ethereum protocol
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
go-ethereum/vendor/github.com/jackpal/go-nat-pmp
Felix Lange 2c4455b12a vendor: update dependencies with github.com/kardianos/govendor 8 years ago
..
LICENSE Godeps, vendor: convert dependency management to trash (#3198) 8 years ago
README.md Godeps, vendor: convert dependency management to trash (#3198) 8 years ago
natpmp.go Godeps, vendor: convert dependency management to trash (#3198) 8 years ago
network.go Godeps, vendor: convert dependency management to trash (#3198) 8 years ago
recorder.go Godeps, vendor: convert dependency management to trash (#3198) 8 years ago

README.md

go-nat-pmp

A Go language client for the NAT-PMP internet protocol for port mapping and discovering the external IP address of a firewall.

NAT-PMP is supported by Apple brand routers and open source routers like Tomato and DD-WRT.

See http://tools.ietf.org/html/draft-cheshire-nat-pmp-03

Build Status

Get the package

go get -u github.com/jackpal/go-nat-pmp

Usage

import (
    "github.com/jackpal/gateway"
    natpmp "github.com/jackpal/go-nat-pmp"
)

gatewayIP, err = gateway.DiscoverGateway()
if err != nil {
    return
}

client := natpmp.NewClient(gatewayIP)
response, err := client.GetExternalAddress()
if err != nil {
    return
}
print("External IP address:", response.ExternalIPAddress)

Clients

This library is used in the Taipei Torrent BitTorrent client http://github.com/jackpal/Taipei-Torrent

Complete documentation

http://godoc.org/github.com/jackpal/go-nat-pmp

License

This project is licensed under the Apache License 2.0.