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

Function WithLocalCredentials

agent_options.go:559–577  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
559func 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.
580func WithTCPMux(tcpMux TCPMux) AgentOption {

Callers 2

TestAgentUpdateOptionsFunction · 0.85
TestWithLocalCredentialsFunction · 0.85

Calls

no outgoing calls

Tested by 2

TestAgentUpdateOptionsFunction · 0.68
TestWithLocalCredentialsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…