Rocket/contrib/ws
Łukasz Wojniłowicz a742d3da4f Symlink license files in all crate directories.
Resolves #2760.
2024-04-06 20:46:07 -07:00
..
src Add 'WebSocket::accept_key()'. 2024-03-20 14:18:39 -07:00
Cargo.toml Bump MSRV to 1.75 for `async fn` in traits. 2024-01-30 09:18:43 -08:00
LICENSE-APACHE Symlink license files in all crate directories. 2024-04-06 20:46:07 -07:00
LICENSE-MIT Symlink license files in all crate directories. 2024-04-06 20:46:07 -07:00
README.md Update 'SergioBenitez/Rocket' to 'rwf2/Rocket'. 2023-11-21 16:32:25 +01:00

README.md

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.0" }
    
  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.