mirror of https://github.com/rwf2/Rocket.git
055ad107df
Prior to this commit, all forward outcomes resulted in a 404. This commit changes request and data guards so that they are able to provide a `Status` on `Forward` outcomes. The router uses this status, if the final outcome is to forward, to identify the catcher to invoke. The net effect is that guards can now customize the status code of a forward and thus the error catcher invoked if the final outcome of a request is to forward. Resolves #1560. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
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-rc.3" }
-
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.