#websocket #finchers #tungstenite

finchers-tungstenite

WebSocket support for Finchers, based on tungstenite

2 unstable releases

0.2.0 Oct 8, 2018
0.1.0 Oct 2, 2018

#34 in WebSocket

Download history 18/week @ 2018-10-16 3/week @ 2018-10-23 14/week @ 2018-10-30 9/week @ 2018-11-06 19/week @ 2018-11-13 4/week @ 2018-11-20 2/week @ 2018-11-27 8/week @ 2018-12-04 3/week @ 2018-12-11 19/week @ 2018-12-18 2/week @ 2018-12-25 1/week @ 2019-01-01 4/week @ 2019-01-08 3/week @ 2019-01-15 1/week @ 2019-01-22

34 downloads per month

MIT/Apache

10KB
189 lines

finchers-tungstenite

crates.io Docs.rs dependency status Build Status Coverage Status

WebSocket support for Finchers based on tungstenite.

License

MIT license or Apache License, Version 2.0 at your option.


lib.rs:

WebSocket support for Finchers based on tungstenite.

Example

#[macro_use]
extern crate finchers;
extern crate finchers_tungstenite;
# extern crate futures;

use finchers::prelude::*;
use finchers_tungstenite::{
  Ws,
  WsTransport,
};

# fn main() {
let endpoint = path!(@get / "ws" /)
    .and(finchers_tungstenite::ws())
    .map(|ws: Ws| {
        ws.on_upgrade(|ws: WsTransport| {
            // ...
#           drop(ws);
#           futures::future::ok(())
        })
    });
# drop(|| {
# finchers::server::start(endpoint)
#     .serve("127.0.0.1:4000")
#     .unwrap();
# });
# }

Dependencies

~9.5MB
~189K SLoC