-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Provide From<Message> for Request
#1036
Comments
That definitely sounds good. This is basically for this line: https://github.com/hyperium/hyper/blob/master/src/server/mod.rs#L258 So, |
Yeah that's the impl I was thinking of. I don't think users would use this explicitly, but that way Hyper "as is" would hook into tokio-proto's |
This implements `From<Message> for Request` and `Into<Message> for Response`, allowing an `Http` instance to be used with a `TcpServer` from tokio-proto. Closes #1036 BREAKING CHANGE: This makes `Request.remote_addr` an `Option<SocketAddr>`, instead of `SocketAddr`.
This implements `From<Message> for Request` and `Into<Message> for Response`, allowing an `Http` instance to be used with a `TcpServer` from tokio-proto. Closes #1036 BREAKING CHANGE: This makes `Request.remote_addr` an `Option<SocketAddr>`, instead of `SocketAddr`.
I've taken most of the ideas learned here about spawning servers back to tokio-proto in tokio-rs/tokio-proto#135 and I believe the only remaining blocker for hyper being compatible with tokio-proto's
TcpServer
is the usage ofSocketAddr
in Hyper's request type. If this can be handled to implementFrom<Message> for Request
then Hyper could leverage support in tokio-rs/tokio-proto#130 to useTcpServer
directly, especially when working with TLS connections where Hyper's conveniences won't be available.Talking with @carllerche over lunch today one idea was to have the socket address be a member of the messages coming from the
Stream
going into tokio-proto. That way the message itself would contain the socket address. I could imagine this being implemented via a trait bound in Hyper perhaps?What do you think?
The text was updated successfully, but these errors were encountered: