Tags: pion/ice
Tags
Respect transport parameters and allowed net types (#901) ## Summary This change makes transport/network-type handling consistent across candidate gathering and remote candidate admission. It fixes cases where the ICE agent could use STUN/TURN URLs with mismatched transport or accept remote candidates on disabled network types. ## What changed ### 1) Remote candidate filtering by configured network types - Added a guard in `addRemoteCandidate` to ignore candidates whose `NetworkType` is not enabled in `AgentConfig.NetworkTypes`. - Added logging for ignored candidates. ### 2) URL transport interpretation and filtering - Added helpers: - `effectiveURLProtoType` (applies default transport when URI transport is omitted) - `urlSupportsSrflxGathering` - `relayNetworkTypesForURL` - `configuredNetworkTypes` - Applied this logic to srflx gathering (`gatherCandidatesSrflx`, `gatherCandidatesSrflxUDPMux`) so only valid UDP URLs are used. ### 3) Relay gathering honors network types and filtered local binds - Refactored relay gathering to select per-URL/per-network-type behavior instead of hardcoded network assumptions. - Kept support for interface/IP filtered local binding addresses in relay/srflx paths. - Replaced manual host:port formatting in srflx paths with `net.JoinHostPort(..., strconv.Itoa(...))` for safer address construction. ### 4) IPv6 TURN status (important) - IPv6 TURN code paths were updated and covered by tests, but full IPv6 TURN support is not complete yet. - For now, IPv6 TURN relay gathering is intentionally disabled in runtime path. - Related IPv6 relay test scenario is present but currently skipped (`t.Skip("IPv6 TURN is not supported yet")`). ### Reference issue Fixes #367
Cancel gathering before removing candidates (#842) #### Description When ICE agent is closed, the connections from UDP/TCP mux were removed before gathering was canceled. This led to candidate gathering adding entries to UDP mux which were not cleaned up. ~Also passing into logger to the mux as ICE agent logger could have more context and is useful to see the context.~
PreviousNext