Overview
AgentConfig collects arguments for ICE Agent construction into a single structure. It provides backward compatibility but is less flexible than the functional options pattern.
Type Definition
Fields
Network Configuration
List of STUN/TURN server URLs for gathering server reflexive and relay candidates.
Minimum UDP port for host candidates. 0 allows the OS to choose.
Maximum UDP port for host candidates. 0 allows the OS to choose.
Enabled network types for gathering. Empty enables all types (UDP4, UDP6, TCP4, TCP6).
Enabled candidate types. Default: host, server reflexive, and relay.
Credentials
Local username fragment. Must have at least 24 bits of entropy if specified.
Local password. Must have at least 128 bits of entropy if specified.
Timeouts
Duration before transitioning to disconnected state. Set to 0 to disable.
Duration after disconnected before transitioning to failed. Set to 0 to disable.
Interval for sending keepalive packets. Set to 0 to disable.
How often to run connectivity checks while connecting.
Wait time for STUN server responses during gathering.
Candidate Acceptance
Minimum wait before selecting host candidates.
Minimum wait before selecting server reflexive candidates.
Minimum wait before selecting peer reflexive candidates.
Minimum wait before selecting relay candidates.
Multicast DNS
Controls mDNS behavior for local candidate resolution.
Hostname for mDNS. Must end with “.local”. Auto-generated if empty.
Advanced Options
Maximum binding requests before considering a candidate pair failed.
Enable ICE-lite mode. Lite agents only gather host candidates and don’t perform connectivity checks.
Include loopback addresses in candidate gathering.
Disable creation of active TCP candidates.
Value subtracted from TCP candidate priorities relative to UDP.
Skip certificate verification for TLS/DTLS TURN connections.
For lite agents, check priority before switching pairs on USE-CANDIDATE.
Deprecated Fields
List of public IP addresses for 1:1 NAT mapping.
Candidate type for NAT1To1IPs (host or srflx).
Accept aggressive nomination from peer.
Filters and Handlers
Function to whitelist/blacklist network interfaces by name.
Function to whitelist/blacklist IP addresses.
Custom handler for incoming STUN binding requests.
Multiplexing
UDP multiplexer for server reflexive candidates. See UniversalUDPMux.
Transport
Custom network implementation (for testing or virtual networks).
Proxy dialer for TURN connections through corporate proxies.
Logging
Logger factory for creating structured loggers.
Migration Guide
Related
- Agent - Main ICE Agent type
- Agent Options - Functional options for agent creation