5 releases
Uses old Rust 2015
0.1.4 | Jul 27, 2016 |
---|---|
0.1.3 | Jul 23, 2016 |
0.1.2 | Jul 22, 2016 |
0.1.1 | Jul 18, 2016 |
0.1.0 | Jul 17, 2016 |
#57 in #iron
28 downloads per month
Used in socket-io
29KB
740 lines
engine.io-rs
An engine.io library for Iron. For the moment, the only supported transport is JSONP. WIP.
lib.rs
:
Hello World
extern crate engine_io;
extern crate iron;
use iron::prelude::*;
use engine_io::server::Server;
fn main() {
let s = Server::new();
s.on_connection(|so| {
println!("connected to {}", so.id());
so.on_message(|m| {
println!("message: {}", String::from_utf8(m.to_vec()).unwrap());
});
so.send(("Hello, world!").as_bytes().to_vec())
});
println!("listening");
Iron::new(s).http("localhost:3000").unwrap();
}
Dependencies
~7.5MB
~147K SLoC