iceconfig

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: AGPL-3.0 Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
const (
	MaximumURLs        = 8
	MaximumURLBytes    = 512
	MaximumSecretBytes = 1024
	MaximumIDBytes     = 64
)

Variables

View Source
var ErrConfiguration = errors.New("invalid ICE connection configuration")

Functions

func ValidateRelayURL

func ValidateRelayURL(raw string) error

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 Expiring

func Expiring(username, password string, expires time.Time) (Credentials, error)

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

func (Credentials) ValidAt

func (c Credentials) ValidAt(now time.Time) bool

type Identity

type Identity struct {
	Provider string
	Account  string
	Profile  string
}

func (Identity) Validate

func (id Identity) Validate() error

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) Identity

func (r Relay) Identity() Identity

func (Relay) Transports

func (r Relay) Transports() []RelayTransport

func (Relay) URLs

func (r Relay) URLs() []string

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"
)

Jump to

Keyboard shortcuts

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