3 releases

0.1.1 May 23, 2024
0.1.0 Nov 17, 2023
0.1.0-rc.4 Nov 2, 2023

#105 in WebSocket

Download history 1275/week @ 2024-09-07 1380/week @ 2024-09-14 1309/week @ 2024-09-21 1768/week @ 2024-09-28 1520/week @ 2024-10-05 2053/week @ 2024-10-12 1677/week @ 2024-10-19 1643/week @ 2024-10-26 1339/week @ 2024-11-02 1469/week @ 2024-11-09 1586/week @ 2024-11-16 1869/week @ 2024-11-23 1650/week @ 2024-11-30 1928/week @ 2024-12-07 1976/week @ 2024-12-14 1007/week @ 2024-12-21

6,883 downloads per month
Used in 4 crates

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.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.

Dependencies

~14–45MB
~779K SLoC