ice

package
v0.0.0-...-8728e54 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeHost            = "host"
	TypeServerReflexive = "srflx"
	TypePeerReflexive   = "prflx"
	TypeRelay           = "relay"
)
View Source
const (
	AttrPriority       = uint16(0x0024)
	AttrUseCandidate   = uint16(0x0025)
	AttrIceControlled  = uint16(0x8029)
	AttrIceControlling = uint16(0x802a)
)

STUN attributes introduced by the RFC 5245 Section 19.1

View Source
const (
	CodeRoleConflict = 487
)

STUN errors codes introduced by the RFC 5245 Section 19.2

Variables

View Source
var DefaultConfig = &Config{}

Functions

func ErrorText

func ErrorText(code int) string

ErrorText returns a reason phrase text for the STUN error code. It returns the empty string if the code is unknown.

func GetAttributeCodec

func GetAttributeCodec(at uint16) (c stun.AttrCodec)

GetAttributeCodec returns a STUN attribute codec for TURN.

func GetAttributeName

func GetAttributeName(at uint16) (n string)

GetAttributeName returns a STUN attribute name. It returns the empty string if the attribute is unknown.

Types

type Agent

type Agent struct {
	Username string
	Password string
	// contains filtered or unexported fields
}

Agent represents an ICE agent.

type Candidate

type Candidate struct {
	Type       string
	Transport  string
	Address    *stun.Addr
	BaseAddr   *stun.Addr
	Priority   uint32
	Foundation int
}

func NewLocalCandidates

func NewLocalCandidates(transports ...string) ([]*Candidate, error)

type Config

type Config struct {
	Server   []*Server
	Networks []string // "udp", "udp4", "udp6", "tcp", "tcp4" or "tcp6"
}

type Server

type Server struct {
	URI      string
	Username string
	Password string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL