Rocket/contrib/ws
Sergio Benitez 34321b418f New version: rocket_ws 0.1.1. 2024-05-22 20:38:53 -05:00
..
src New version: rocket_ws 0.1.1. 2024-05-22 20:38:53 -05:00
Cargo.toml New version: rocket_ws 0.1.1. 2024-05-22 20:38:53 -05:00
LICENSE-APACHE Symlink license files in all crate directories. 2024-05-22 13:41:37 -05:00
LICENSE-MIT Symlink license files in all crate directories. 2024-05-22 13:41:37 -05:00
README.md New version: rocket_ws 0.1.1. 2024-05-22 20:38:53 -05: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.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.