Documentation ¶
Overview ¶
Package upnp implements a simple UPnP client suitable for NAT traversal.
Index ¶
- type Client
- func (c *Client) AddPortMapping(descr string, internalPort, externalPort, duration int) error
- func (c *Client) Close()
- func (c *Client) DeletePortMapping(internalPort, externalPort int) error
- func (c *Client) GetExternalIPAddress() (net.IP, error)
- func (c *Client) GetListOfPortMappings() ([]string, error)
- func (c *Client) Vlogf(f string, a ...interface{})
- type ClientFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is UPnP client instance.
func (*Client) AddPortMapping ¶
AddPortMapping adds a new TCP/IP port mapping. The internal IP address of the client is used as the destination. Per the UPnP spec, duration can range from 0 to 604800, with the behavior on 0 changing depending on the version of the spec.
func (*Client) DeletePortMapping ¶
DeletePortMapping removes an existing TCP/IP port forwarding entry between clientIP:internalPort and 0.0.0.0:externalPort.
func (*Client) GetExternalIPAddress ¶
GetExternalIPAddress queries the router's external IP address.
func (*Client) GetListOfPortMappings ¶
GetListOfPortMappings queries the router for the list of port forwarding entries.
type ClientFactory ¶
type ClientFactory struct{}
func (*ClientFactory) Name ¶
func (f *ClientFactory) Name() string
Click to show internal directories.
Click to hide internal directories.