Documentation ¶
Overview ¶
go-stun is a STUN (RFC 3489 and RFC 5389) client implementation in golang.
It is extremely easy to use -- just one line of code.
nat, host, err := stun.NewClient().Discover()
More details please go to `example.go`.
Index ¶
Constants ¶
View Source
const ( DefaultServerHost = "stun1.voiceeclipse.net" DefaultServerPort = 3478 DefaultSoftwareName = "StunClient" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
func (*Client) Discover ¶
Discover contacts the STUN server and gets the response of NAT type, host for UDP punching.
func (*Client) ServerAddr ¶
func (*Client) SetServerAddr ¶
SetServerAddr allows user to set the transport layer STUN server address.
func (*Client) SetServerHost ¶
SetServerHost allows user to set the STUN hostname and port.
func (*Client) SetSoftwareName ¶
SetSoftwareName allows user to set the name of the software, which is used for logging purpose (NOT used in the current implementation).
func (*Client) SoftwareName ¶
type Host ¶
type Host struct {
// contains filtered or unexported fields
}
func (*Host) TransportAddr ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.