WithCandidateTypes sets the enabled candidate types for gathering. By default, host, server reflexive, and relay candidates are enabled. Example: agent, err := NewAgentWithOptions( WithCandidateTypes([]CandidateType{CandidateTypeHost, CandidateTypeServerReflexive}), )
(candidateTypes []CandidateType)
| 938 | // WithCandidateTypes([]CandidateType{CandidateTypeHost, CandidateTypeServerReflexive}), |
| 939 | // ) |
| 940 | func WithCandidateTypes(candidateTypes []CandidateType) AgentOption { |
| 941 | return func(a *Agent) error { |
| 942 | if a.constructed { |
| 943 | return ErrAgentOptionNotUpdatable |
| 944 | } |
| 945 | |
| 946 | a.candidateTypes = candidateTypes |
| 947 | |
| 948 | return nil |
| 949 | } |
| 950 | } |
| 951 | |
| 952 | // WithAutomaticRenomination enables automatic renomination of candidate pairs |
| 953 | // when better pairs become available after initial connection establishment. |
no outgoing calls
searching dependent graphs…