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)
| 867 | // WithNetworkTypes([]NetworkType{NetworkTypeUDP4, NetworkTypeUDP6}), |
| 868 | // ) |
| 869 | func 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). |
searching dependent graphs…