1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
//! ## Hello World //! //! ```no_run //! 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(); //! } //! ``` #[macro_use] extern crate iron; extern crate rand; extern crate url; extern crate rustc_serialize as serialize; extern crate crypto; extern crate modifier; extern crate cookie; extern crate time; extern crate hyper; #[macro_use] extern crate log; pub mod packet; pub mod server; pub mod socket; pub mod config;