Skip to main content

connect

Function connect 

Source
pub async fn connect<S>(
    stream: S,
    authority: &str,
    path: &str,
    secure: bool,
) -> Result<Socket<S>, WsError>
where S: AsyncRead + AsyncWrite + Unpin,
Expand description

Perform the client half of the handshake, asking for the sip subprotocol at path.

authority is the host and port from the URI — what goes in Host, and under WSS the name the certificate had to be valid for. path is the resource to ask for: RFC 7118 §5 does not fix one, so where a server serves SIP is the server’s business and the caller’s to know.