mirror of https://github.com/rwf2/Rocket.git
a742d3da4f
Resolves #2760. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
LICENSE-APACHE | ||
LICENSE-MIT | ||
README.md |
README.md
ws
This crate provides WebSocket support for Rocket via integration with Rocket's [connection upgrades] API.
Usage
-
Depend on
rocket_ws
, renamed here tows
:[dependencies] ws = { package = "rocket_ws", version = "0.1.0" }
-
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.