Documentation
¶
Index ¶
- func Connect(xchg ExchangeCandidatesFun, initiator bool) (net.Conn, error)
- func ConnectOpt(xchg ExchangeCandidatesFun, initiator bool, cfg *Config) (net.Conn, error)
- func GatherCandidates(sock *net.UDPConn, ifaces []string, blacklist []*net.IPNet) ([]candidate, error)
- type Config
- type Conn
- func (c *Conn) Close() error
- func (c *Conn) LocalAddr() net.Addr
- func (c *Conn) Read(b []byte) (int, error)
- func (c *Conn) RemoteAddr() net.Addr
- func (c *Conn) SetDeadline(t time.Time) error
- func (c *Conn) SetReadDeadline(t time.Time) error
- func (c *Conn) SetWriteDeadline(t time.Time) error
- func (c *Conn) Write(b []byte) (int, error)
- type ExchangeCandidatesFun
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectOpt ¶
Types ¶
type Config ¶
type Config struct {
// ProbeTimeout is the duration between sending probes.
ProbeTimeout time.Duration
// DecisionTime is how much time we wait before checking (on the
// initiator) all the links that successfully communicated (so they got
// stun.ClassSuccess in response to a stun.ClassRequest) and deciding
// which one to use.
DecisionTime time.Duration
// PeerDeadline is the duration for which the negotiation must go
// on. Please note this must be > DecisionTime because after the
// initiator decided which link to use, we need to have one more
// complete round-trip (stun.ClassSuccess in response to a
// stun.ClassRequest) but with UseCandidate set to true.
PeerDeadline time.Duration
// Prints all the ongoing handshakes.
Verbose bool
// Bind locally to a specific address.
BindAddress *net.UDPAddr
// Which interfaces use for ICE.
UseInterfaces []string
// Blacklist given addresses for ICE negotiation.
BlacklistAddresses []*net.IPNet
// TOS, if >0, sets IP_TOS to this value. Note an error is considered
// non-fatal, it is just logged.
TOS int
}
func DefaultConfig ¶
func DefaultConfig() *Config
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) RemoteAddr ¶
type ExchangeCandidatesFun ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package stun implements a subset of the Session Traversal Utilities for NAT (STUN) protocol, described in RFC 5389.
|
Package stun implements a subset of the Session Traversal Utilities for NAT (STUN) protocol, described in RFC 5389. |
|
stunclient
command
stunclient is a simple STUN client implementation using the STUN library.
|
stunclient is a simple STUN client implementation using the STUN library. |
Click to show internal directories.
Click to hide internal directories.