SetRemoteCredentials sets the credentials of the remote agent.
(remoteUfrag, remotePwd string)
| 1852 | |
| 1853 | // SetRemoteCredentials sets the credentials of the remote agent. |
| 1854 | func (a *Agent) SetRemoteCredentials(remoteUfrag, remotePwd string) error { |
| 1855 | switch { |
| 1856 | case remoteUfrag == "": |
| 1857 | return ErrRemoteUfragEmpty |
| 1858 | case remotePwd == "": |
| 1859 | return ErrRemotePwdEmpty |
| 1860 | } |
| 1861 | |
| 1862 | return a.loop.Run(a.loop, func(_ context.Context) { |
| 1863 | a.remoteUfrag = remoteUfrag |
| 1864 | a.remotePwd = remotePwd |
| 1865 | }) |
| 1866 | } |
| 1867 | |
| 1868 | // UpdateOptions applies the given options to the agent at runtime. |
| 1869 | // Only a subset of options can be updated after agent creation: |