WithLocalCredentials sets the local ICE username fragment and password used during Restart. If empty strings are provided, the agent will generate values during Restart.
(ufrag, pwd string)
| 557 | // WithLocalCredentials sets the local ICE username fragment and password used during Restart. |
| 558 | // If empty strings are provided, the agent will generate values during Restart. |
| 559 | func WithLocalCredentials(ufrag, pwd string) AgentOption { |
| 560 | return func(a *Agent) error { //nolint:varnamelen |
| 561 | if a.constructed { |
| 562 | return ErrAgentOptionNotUpdatable |
| 563 | } |
| 564 | |
| 565 | if ufrag != "" && len([]rune(ufrag))*8 < 24 { |
| 566 | return ErrLocalUfragInsufficientBits |
| 567 | } |
| 568 | if pwd != "" && len([]rune(pwd))*8 < 128 { |
| 569 | return ErrLocalPwdInsufficientBits |
| 570 | } |
| 571 | |
| 572 | a.localUfrag = ufrag |
| 573 | a.localPwd = pwd |
| 574 | |
| 575 | return nil |
| 576 | } |
| 577 | } |
| 578 | |
| 579 | // WithTCPMux sets the TCP mux for ICE TCP multiplexing. |
| 580 | func WithTCPMux(tcpMux TCPMux) AgentOption { |
no outgoing calls
searching dependent graphs…