Closed
Description
When writing a server in Hyper I should be able to retrieve the remote IP address from the request.
@seanmonstar mentioned in #1410 that an API similar to the client (#1402) might be relevant?
API usage could then look like this:
fn respond_with_sender_ip(request: Request<Body>) -> BoxFut {
let remote_address = request
.extensions()
.get::<HttpInfo>()
.expect("something something sets HttpInfo")
.remote_addr();
Box::new(future::ok(Response::new(Body::from(remote_address))))
}
(Please edit this to make the proposed API usage correct :-)