2 releases

0.1.0 Nov 17, 2023
0.1.0-rc.4 Nov 2, 2023

#44 in WebSocket

Download history 27/week @ 2023-11-04 275/week @ 2023-11-11 725/week @ 2023-11-18 549/week @ 2023-11-25 814/week @ 2023-12-02 866/week @ 2023-12-09 578/week @ 2023-12-16 528/week @ 2023-12-23 1142/week @ 2023-12-30 1310/week @ 2024-01-06 1069/week @ 2024-01-13 1047/week @ 2024-01-20 1101/week @ 2024-01-27 1317/week @ 2024-02-03 937/week @ 2024-02-10 809/week @ 2024-02-17

4,424 downloads per month
Used in rocket_okapi

MIT/Apache

1MB
14K SLoC

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.

Dependencies

~14–50MB
~802K SLoC