rocket_ws

Crates.iorocket_ws
lib.rsrocket_ws
version0.1.1
sourcesrc
created_at2023-11-02 00:52:05.082643
updated_at2024-05-23 20:35:48.796705
descriptionWebSocket support for Rocket.
homepagehttps://rocket.rs
repositoryhttps://github.com/rwf2/Rocket/tree/v0.5/contrib/ws
max_upload_size
id1022034
size38,119
Sergio Benitez (SergioBenitez)

documentation

https://api.rocket.rs/v0.5/rocket_ws/

README

ws ci.svg crates.io docs.svg

This crate provides WebSocket support for Rocket via integration with Rocket's [connection upgrades] API.

Usage

  1. Depend on rocket_ws, renamed here to ws:

    [dependencies]
    ws = { package = "rocket_ws", version = "0.1.1" }
    
  2. Use it!

    #[get("/echo")]
    fn echo_stream(ws: ws::WebSocket) -> ws::Stream!['static] {
        ws::Stream! { ws =>
            for await message in ws {
                yield message?;
            }
        }
    }
    

See the crate docs for full details.

Commit count: 2385

cargo fmt