pub async fn client_async_tls<R, S>(
    request: R,
    stream: S,
) -> Result<(WebSocketStream<AutoStream<S>>, Response), Error>
where
    R: Into<Request<'static>> + Unpin,
    S: 'static + AsyncRead + AsyncWrite + Send + Unpin,
    AutoStream<S>: Unpin,
{
    let request: Request = request.into();

    let domain = domain(&request)?;

    // Make sure we check domain and mode first. URL must be valid.
    let mode = url_mode(&request.url)?;

    let stream = wrap_stream(stream, domain, mode).await?;
    client_async(request, stream).await
}
/// Creates a WebSocket handshake from a request and a stream,
/// upgrading the stream to TLS if required.
Creates a WebSocket handshake from a request and a stream,
upgrading the stream to TLS if required.
Creates a WebSocket handshake from a request and a stream upgrading the stream to TLS if required .
pub async fn client_async_tls<R, S>(
    request: R,
    stream: S,
) -> Result<(WebSocketStream<AutoStream<S>>, Response), Error>
where
    R: Into<Request<'static>> + Unpin,
    S: 'static + AsyncRead + AsyncWrite + Send + Unpin,
    AutoStream<S>: Unpin,
{
    let request: Request = request.into();
    let domain = domain(&request)?;
    // Make sure we check domain and mode first. URL must be valid.
    let mode = url_mode(&request.url)?;
    let stream = wrap_stream(stream, domain, mode).await?;
    client_async(request, stream).await
}
pub async fn client_async_tls < R , S > ( request : R , stream : S , ) -> Result < ( WebSocketStream < AutoStream < S > > , Response ) , Error > where R : Into < Request < ' static > > + Unpin , S : ' static + AsyncRead + AsyncWrite + Send + Unpin , AutoStream < S > : Unpin , { let request : Request = request . into ( ) ; let domain = domain ( & request ) ? ; // Make sure we check domain and mode first. URL must be valid. let mode = url_mode ( & request . url ) ? ; let stream = wrap_stream ( stream , domain , mode ) . await ? ; client_async ( request , stream ) . await }
Creates a WebSocket handshake from a request and a stream,
upgrading the stream to TLS if required.
Creates a WebSocket handshake from a request and a stream upgrading the stream to TLS if required .
request
R
stream
S