websockets-rs / rust-websocket

A WebSocket (RFC6455) library written in Rust
http://websockets-rs.github.io/rust-websocket/
MIT License
1.55k stars 223 forks source link

example doesn't work #84

Closed geyang closed 8 years ago

geyang commented 8 years ago

Hi,

I'm new to rust. I compiled the repo but the main thread is panicking:

     Running `target/debug/examples/server`
thread '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: Error { repr: Os { code: 48, message: "Address already in use" } }', ../src/libcore/result.rs:785
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: Process didn't exit successfully: `target/debug/examples/server` (exit code: 101)
geyang commented 8 years ago

ha never mind:) had another server running.

geyang commented 8 years ago

Ah there is another problem:

when I hit http://localhost:2794, The server renders the following trace:

thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: RequestError("Unsupported WebSocket version")', ../src/libcore/result.rs:785
note: Run with `RUST_BACKTRACE=1` for a backtrace.
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: RequestError("Unsupported WebSocket version")', ../src/libcore/result.rs:785
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: RequestError("Unsupported WebSocket version")', ../src/libcore/result.rs:785

What would be the proper way to fix this?

Thanks: )

geyang commented 8 years ago

I got this to work. The example is working. It is just that the socket port gives an error when the request is not a socket request. I'm closing this one to focus on the real issue, which is handling http request on the same port as the socket.

related to #53