Documentation
¶
Index ¶
Constants ¶
View Source
const ( AllocationTCP = uint8(6) AllocationUDP = uint8(17) )
View Source
const ( MethodAllocate = uint16(0x3) MethodRefresh = uint16(0x4) MethodSend = uint16(0x6) MethodData = uint16(0x7) MethodCreatePermission = uint16(0x8) MethodChannelBind = uint16(0x9) )
STUN methods introduced by the RFC 5766 Section 13.
View Source
const ( AttrChannelNumber = uint16(0x000c) AttrLifeTime = uint16(0x000d) AttrXorPeerAddress = uint16(0x0012) AttrData = uint16(0x0013) AttrXorRelayedAddress = uint16(0x0016) AttrEvenPort = uint16(0x0018) AttrRequestedTransport = uint16(0x0019) AttrDontFragment = uint16(0x001a) AttrReservationToken = uint16(0x0022) )
STUN attributes introduced by the RFC 5766 Section 14.
View Source
const ( CodeForbidden = 403 CodeAllocationMismatch = 437 CodeWrongCredentials = 441 CodeUnsupportedTransportProtocol = 442 CodeAllocationQuotaReached = 486 CodeInsufficientCapacity = 508 )
STUN errors introduced by the RFC 5766 Section 15.
Variables ¶
View Source
var ErrNoAllocationResponse = errors.New("turn: no allocated address")
View Source
var ErrUnsupportedScheme = errors.New("turn: unsupported scheme")
Functions ¶
func ErrorText ¶
ErrorText returns a reason phrase text for the STUN error code. It returns the empty string if the code is unknown.
func GetAttributeCodec ¶
GetAttributeCodec returns a STUN attribute codec for TURN.
func GetAttributeName ¶
GetAttributeName returns a STUN attribute name. It returns the empty string if the attribute is unknown.
func LongTermAuthKey ¶
func LongTermAuthKey(username, password, realm string) func(attrs stun.Attributes) ([]byte, error)
Types ¶
Click to show internal directories.
Click to hide internal directories.