example: trivial: init logger in server example

Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
This commit is contained in:
Alexey Galakhov 2019-05-14 02:10:51 +02:00
parent 8cc65fdddc
commit f4769a950c
1 changed files with 2 additions and 0 deletions

View File

@ -1,4 +1,5 @@
extern crate tungstenite;
extern crate env_logger;
use std::thread::spawn;
use std::net::TcpListener;
@ -7,6 +8,7 @@ use tungstenite::accept_hdr;
use tungstenite::handshake::server::Request;
fn main() {
env_logger::init();
let server = TcpListener::bind("127.0.0.1:3012").unwrap();
for stream in server.incoming() {
spawn(move || {