Struct hyper_reverse_proxy::ReverseProxy
[−]
[src]
pub struct ReverseProxy<C: Service, B = Body> { /* fields omitted */ }
A Service
that takes an incoming request, sends it to a given Client
, then proxies back
the response.
The implementation ensures that Hop-by-hop headers are stripped correctly in both directions,
and adds the client's IP address to a comma-space-separated list of forwarding addresses in the
X-Forwarded-For
header.
The implementation is based on Go's httputil.ReverseProxy
.
Methods
impl<C: Service, B> ReverseProxy<C, B>
[src]
fn new(client: C, remote_ip_addr: Option<IpAddr>) -> ReverseProxy<C, B>
Construct a reverse proxy that dispatches to the given client.
Trait Implementations
impl<C, B> Service for ReverseProxy<C, B> where
B: 'static,
C: Service<Request = Request<B>, Response = Response<B>>,
C::Error: 'static + Display,
C::Future: 'static,
[src]
B: 'static,
C: Service<Request = Request<B>, Response = Response<B>>,
C::Error: 'static + Display,
C::Future: 'static,
type Request = Request<B>
Requests handled by the service.
type Response = Response<B>
Responses given by the service.
type Error = Void
Errors produced by the service.
type Future = Box<Future<Item = Response<B>, Error = Void>>
The future response value.
fn call(&self, request: Self::Request) -> Self::Future
Process the request and return the response asynchronously.