Skip to main content

Crate openwire_fastwebsockets

Crate openwire_fastwebsockets 

Source
Expand description

openwire-fastwebsockets plugs fastwebsockets into openwire’s WebSocketEngine trait so a client can swap the bundled native codec for fastwebsockets’ framing.

use openwire::{Client, RequestBody};
use openwire_fastwebsockets::FastWebSocketsEngine;

let request = http::Request::builder()
    .method(http::Method::GET)
    .uri("ws://127.0.0.1:9001/")
    .body(RequestBody::empty())?;
let client = Client::builder().build()?;
let websocket = client
    .new_websocket(request)
    .engine(FastWebSocketsEngine::shared())
    .execute()
    .await?;

Structs§

FastWebSocketsEngine
fastwebsockets-backed WebSocketEngine implementation.