Documentation ¶
Overview ¶
The NAT package is responsible for
- obtaining a pair of public IP and port that can be announced to external nodes and can be used for sending traffic to this node.
- keep that NAT traversal mechanism active, either by sending keepalives or by notifying the corresponding service about our interest in keeping it active.
Index ¶
- Constants
- Variables
- func GetStun(defaultIp net.IP, defaultPort int) (net.IP, int, error)
- func GetUpnp(defaultIp net.IP, defaultPort int) (net.IP, int, error)
- func NewExternal(addr interface{}) (interface{}, error)
- func NewExternalTCP(tcpAddr net.TCPAddr) (net.TCPAddr, error)
- func NewExternalTCPAddr(addr string) (net.TCPAddr, error)
- func NewExternalUDP(udpAddr net.UDPAddr) (net.UDPAddr, error)
- func NewExternalUDPAddr(addr string) (net.UDPAddr, error)
Constants ¶
View Source
const LOG_MODULE = "divs"
View Source
const STUN_SERVICE_ADDRESS = "stun.ekiga.net:3478"
default STUN server:port
Variables ¶
View Source
var ERR_COULD_NOT_OBTAIN_NAT = errors.New("Could not obtain a valid IP/port")
Could not obtain a valid IP/port with NAT
View Source
var ERR_COULD_NOT_OBTAIN_STUN = fmt.Errorf("Could not obtain a valid IP/port with STUN")
could not obtain a NAT mapping with STUN
View Source
var ERR_COULD_NOT_OBTAIN_UPNP = fmt.Errorf("Could not obtain a valid IP/port with UPNP")
Functions ¶
func NewExternal ¶
func NewExternal(addr interface{}) (interface{}, error)
Obtain a new external address, returning a UDP or TCP address depending on the default value provided.
func NewExternalTCP ¶
Obtain a new external TCP address, providing a default value
func NewExternalTCPAddr ¶
Obtain a new external TCP address, providing the default value as a string
func NewExternalUDP ¶
Obtain a new external UDP address, providing a default value
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.