Function tungstenite::client::connect [−][src]
pub fn connect<Req: IntoClientRequest>(
request: Req
) -> Result<(WebSocket<AutoStream>, Response)>
Connect to the given WebSocket in blocking mode.
The URL may be either ws:// or wss://. To support wss:// URLs, feature “tls” must be turned on.
This function “just works” for those who wants a simple blocking solution
similar to std::net::TcpStream
. If you want a non-blocking or other
custom stream, call client
instead.
This function uses native_tls
to do TLS. If you want to use other TLS libraries,
use client
instead. There is no need to enable the “tls” feature if you don’t call
connect
since it’s the only function that uses native_tls.