Merge pull request #134 from Zoldszemesostoros/patch-1

Make echo server compile
This commit is contained in:
Daniel Abramov 2020-08-17 14:42:29 +02:00 committed by GitHub
commit faea043ec2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 12 deletions

View File

@ -8,6 +8,7 @@ use std::thread::spawn;
use tungstenite::server::accept;
/// A WebSocket echo server
fn main () {
let server = TcpListener::bind("127.0.0.1:9001").unwrap();
for stream in server.incoming() {
spawn (move || {
@ -22,6 +23,7 @@ for stream in server.incoming() {
}
});
}
}
```
Take a look at the examples section to see how to write a simple client/server.