Documentation
¶
Overview ¶
Package iceconfig describes immutable ICE inputs. Discovery and delegated relay authority have different lifetimes and must never share an endpoint pool.
Index ¶
Constants ¶
const ( MaximumURLs = 8 MaximumURLBytes = 512 MaximumSecretBytes = 1024 MaximumIDBytes = 64 )
Variables ¶
var ErrConfiguration = errors.New("invalid ICE connection configuration")
Functions ¶
func ValidateRelayURL ¶
Types ¶
type CandidatePolicy ¶
type CandidatePolicy uint8
const ( AllCandidates CandidatePolicy = iota RelayCandidates )
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
Connection is a snapshot consumed by one gathering generation. Replacing a credential requires a new connection; mutating live Pion configuration does not refresh an existing allocation.
func New ¶
func New(discovery []string, relay *Relay, policy CandidatePolicy) (Connection, error)
func (Connection) DiscoveryURLs ¶
func (c Connection) DiscoveryURLs() []string
func (Connection) Policy ¶
func (c Connection) Policy() CandidatePolicy
func (Connection) Relay ¶
func (c Connection) Relay() (Relay, bool)
type CredentialKind ¶
type CredentialKind uint8
const ( FixedCredential CredentialKind = iota + 1 ExpiringCredential )
type Credentials ¶
type Credentials struct {
// contains filtered or unexported fields
}
Credentials can only be constructed with a known lifetime. The zero value cannot accidentally turn a missing expiry into a permanent password.
func Fixed ¶
func Fixed(username, password string) (Credentials, error)
func (Credentials) ExpiresAt ¶
func (c Credentials) ExpiresAt() time.Time
func (Credentials) Kind ¶
func (c Credentials) Kind() CredentialKind
func (Credentials) Password ¶
func (c Credentials) Password() string
func (Credentials) Username ¶
func (c Credentials) Username() string
type Relay ¶
type Relay struct {
// contains filtered or unexported fields
}
Relay is one service, whose URLs are alternatives, not separate traffic lanes. Pion's pinned TURN gatherer supports IPv4 allocations only; IPv6 discovery remains available on the independent direct path.
func NewRelay ¶
func NewRelay(identity Identity, urls []string, credential Credentials) (Relay, error)
func (Relay) Credentials ¶
func (r Relay) Credentials() Credentials
func (Relay) Transports ¶
func (r Relay) Transports() []RelayTransport
func (Relay) WithTransport ¶
func (r Relay) WithTransport(transport RelayTransport) (Relay, error)
WithTransport narrows authority for both peers without changing the service, credential or exit route. Browser ICE does not honor the order of TURN URLs.
type RelayTransport ¶
type RelayTransport string
RelayTransport describes the client-to-TURN hop, independently of the UDP relay candidate advertised to ICE. Ordering is an initial product preference, not a claim about the throughput of an established connection.
const ( RelayTCP RelayTransport = "tcp" RelayTLS RelayTransport = "tls" RelayUDP RelayTransport = "udp" )