-
Notifications
You must be signed in to change notification settings - Fork 223
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
Update to support Hyper 0.11? #132
Comments
Party! That means they're finally async! That should remove a lot of weird glue I used to hold the two together lol. This is planned, are you hoping to just have it use |
Just looking for the 0.11 update. And yes, all of the examples are fundamentally async and are definitely a lot cleaner looking than they were pre-0.11. |
Do you happen to have a vague sense of when this might happen? It would be helpful to me in my project planning, as I can defer development of my websocket-related piece if it means not having to refactor later to get up to the newest hyper. If its more like a months-from-now kind of thing then I will go ahead and implement using the current version and hyper 0.10 and perhaps refactor later. Thank you! |
I'll try to see what I can do this week and I'll let you know, I feel like it's going to be a small change but I'm always wrong about these things 🙂 |
@generalelectrix I already ran into issues ^ |
Ok, thanks for the update! I'll move ahead running on hyper 0.10 for the time being. Thank you for your work on this library, it is working nicely and is easy to use. |
Yes, that would be awesome! I started a new project like two hours ago and already got stuck on this issue. My setup: Hyper (0.11) listens on Port 80 for incoming connections. If the hyper request matches a certain path (like "/websocket") I try to upgrade the connection. At the moment this fails with: error[E0308]: mismatched types
--> src/main.rs:60:36
|
60 | match HyperRequest(req).into_ws() {
| ^^^ expected struct `hyper::server::request::Request`, found struct `hyper::Request`
|
= note: expected type `hyper::server::request::Request<'_, '_>`
found type `hyper::Request` Since the request types of the two hyper versions don't match. |
@dthul Yeah it's expecting the |
I think the move is to ditch |
@illegalprime Thanks for the tip with |
@dthul I'll take a look when I get home, it gets down to how do you extract the stream that hyper is giving us. |
@dthul I still need to test this, but I think what you have to do is verify the headers yourself, create a TcpConnection connecting to https://docs.rs/hyper/0.11.0/hyper/struct.Request.html#method.remote_addr , send the rest of the handshake, and finally wrap the connection in the websocket codec. This is too involved for a normal user so I want to push a hotfix soon that will implement |
I get a "connection refused" error when I try to connect to the |
@dthul oh I see. Yeah this is really tough, unless we can get access to the live connection hyper is using we can't transform it into websockets. If there's no way to do it I'll open a bug in hyper. |
@illegalprime Did you ever figure out a way to do this? |
also interested how to put websocket handler into latest hyper webserver with tokio and async. |
@nicoburns @maxlapshin I basically have to rip out hyper and use an http parser, so we'll likely lose support for using hyper headers in making connections. Is that a feature that would be missed? |
I (independently) wrote https://github.com/spinda/hyper-websocket and hyperium/hyper#1287 to solve this problem. |
Also, the option to build without hyper would be really nice for my use case (hyper-based HTTP server which upgrades connections to WebSockets, all using async I/O with Tokio), as long as something like WsUpgrade is still present to be able to either accept or reject a handshake that was parsed outside the |
Anything new on that ? :) |
@spinda about to finish finals, so I'm excited to get some time. |
Is hyperium/hyper#1563 relevant here? |
Is there any progress here? This crate is slowly drifting out of sync with the rest of the web ecosystem; the current version of hyper is 0.12.16 and this issue to upgrade to 0.11 hasn't seen any signs of life in nearly a year. I'm willing to take a shot at the upgrade, but I'll need some assistance because I'm far from an expert on this subject. |
The closest thing is this fork. I don't know how ready is it for a crates.io release...
If you want to contribute hyper update, you should probably assume that #199 is merged and also look at Enzious fork where things are supposedly done. |
Hyper broke a lot of stuff moving to 0.11, and all of the contemporary Hyper examples are incompatible with rust-websocket. Any horizon on a patch to support the latest Hyper?
The text was updated successfully, but these errors were encountered: