3 releases

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

#90 in WebSocket

Download history 1097/week @ 2024-07-19 1089/week @ 2024-07-26 1135/week @ 2024-08-02 1540/week @ 2024-08-09 1048/week @ 2024-08-16 1312/week @ 2024-08-23 1531/week @ 2024-08-30 1171/week @ 2024-09-06 1408/week @ 2024-09-13 1401/week @ 2024-09-20 1621/week @ 2024-09-27 1584/week @ 2024-10-04 1892/week @ 2024-10-11 1886/week @ 2024-10-18 1590/week @ 2024-10-25 1374/week @ 2024-11-01

6,977 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
~777K SLoC