Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example for HyperResponse doesn't compile #173

Open
lpil opened this issue Apr 19, 2018 · 3 comments
Open

Example for HyperResponse doesn't compile #173

lpil opened this issue Apr 19, 2018 · 3 comments

Comments

@lpil
Copy link

lpil commented Apr 19, 2018

Hello!

I attempted to compile the HyperResponse example (http://cyderize.github.io/rust-websocket/doc/websocket/server/upgrade/sync/struct.HyperRequest.html) with current Hyper, but it doesn't type check.

error[E0599]: no function or associated item named `http` found for type `hyper::Server<_, _>` in the
current scope
 --> src/server/mod.rs:7:5
  |
7 |     Server::http("0.0.0.0:80")
  |     ^^^^^^^^^^^^ function or associated item not found in `hyper::Server<_, _>`

error[E0308]: mismatched types
  --> src/server/mod.rs:10:32
   |
10 |             match HyperRequest(req).into_ws() {
   |                                ^^^ expected struct `hyper::server::request::Request`, found struc
t `hyper::Request`
   |
   = note: expected type `hyper::server::request::Request<'_, '_>`
              found type `hyper::Request`

error[E0599]: no method named `send` found for type `hyper::Response` in the current scope
  --> src/server/mod.rs:23:25
   |
23 |                     res.send(b"Try connecting over ws instead.").unwrap();
   |                         ^^^^

error: aborting due to 3 previous errors
@thebeekeeper
Copy link

Trying out the same thing here, and it compiles if you use a different version of Hyper. For me it's compiling with hyper = "^0.10.6"

@kpp
Copy link
Contributor

kpp commented May 1, 2019

Would you please close this issue as resolved? Sometime in the future this project will support a modern versions of hyper, but for now you have to stick to ^0.10.6

@Lightnet
Copy link

Is there update version example hyper which is current broken?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants