MCPcopy Create free account
hub / github.com/pion/ice / WithNetworkTypes

Function WithNetworkTypes

agent_options.go:869–884  ·  view source on GitHub ↗

WithNetworkTypes sets the enabled candidate network types for candidate gathering. This controls the network types exposed in ICE candidates and used for pairing. Use WithTURNTransportProtocols to control the local TURN client-to-server transport. By default, all network types are enabled. Example:

(networkTypes []NetworkType)

Source from the content-addressed store, hash-verified

867// WithNetworkTypes([]NetworkType{NetworkTypeUDP4, NetworkTypeUDP6}),
868// )
869func WithNetworkTypes(networkTypes []NetworkType) AgentOption {
870 return func(a *Agent) error {
871 if a.constructed {
872 return ErrAgentOptionNotUpdatable
873 }
874
875 normalized, err := sanitizeTransportNetworkTypes(networkTypes)
876 if err != nil {
877 return err
878 }
879
880 a.networkTypes = normalized
881
882 return nil
883 }
884}
885
886// WithTURNTransportProtocols restricts protocols used by this agent when
887// connecting to TURN servers (TURN client <-> TURN server transport).

Calls 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…