aboutsummaryrefslogtreecommitdiff
path: root/server/src/routes/streamsync.rs
blob: d4a4d7e6218fc94487162155c4afb1af9822159f (plain)
1
2
3
4
5
6
7
8
9
10
11
use rocket::get;
use rocket_ws::{Stream, WebSocket};

#[get("/streamsync")]
pub fn r_streamsync(ws: WebSocket) -> Stream!['static] {
    Stream! { ws =>
        for await message in ws {
            yield message?;
        }
    }
}