Struct actix_web::ws::WsClient
[−]
[src]
pub struct WsClient { /* fields omitted */ }WebSocket client
Example of WebSocket client usage is available in
websocket example
Methods
impl WsClient[src]
fn new<S: AsRef<str>>(uri: S) -> WsClient[src]
Create new websocket connection
fn with_connector<S: AsRef<str>>(
uri: S,
conn: Addr<Unsync, ClientConnector>
) -> WsClient[src]
uri: S,
conn: Addr<Unsync, ClientConnector>
) -> WsClient
Create new websocket connection with custom ClientConnector
fn protocols<U, V>(self, protos: U) -> Self where
U: IntoIterator<Item = V> + 'static,
V: AsRef<str>, [src]
U: IntoIterator<Item = V> + 'static,
V: AsRef<str>,
Set supported websocket protocols
[src]
Set cookie for handshake request
fn origin<V>(self, origin: V) -> Self where
HeaderValue: HttpTryFrom<V>, [src]
HeaderValue: HttpTryFrom<V>,
Set request Origin
fn max_frame_size(self, size: usize) -> Self[src]
Set max frame size
By default max size is set to 64kb
fn header<K, V>(self, key: K, value: V) -> Self where
HeaderName: HttpTryFrom<K>,
HeaderValue: HttpTryFrom<V>, [src]
HeaderName: HttpTryFrom<K>,
HeaderValue: HttpTryFrom<V>,
Set request header
fn connect(&mut self) -> WsClientHandshake[src]
Connect to websocket server and do ws handshake