#reverse-proxy #iron #reverse #proxy #middleware #request-url #x-forwarded-host

iron_reverse_proxy

BeforeMiddleware to handle being behind a reverse proxy in Iron. Supports X-Forwarded-Host, X-Forwarded-Port, X-Forwarded-Proto.

2 releases

Uses old Rust 2015

0.1.1 Jan 13, 2018
0.1.0 Jan 13, 2018

#10 in #request-url

MIT license

7KB
75 lines

iron_reverse_proxy Build Status

Some simple BeforeMiddleware to make using Iron behind a reverse proxy easier.

Usage:

extern crate iron_reverse_proxy;

use iron::prelude::*;

let mut ch = Chain::new();
ch.link_before(iron_reverse_proxy::ReverseProxyMiddleware);

And you're done. Works particularly well with router's url_for! macro, as it depends on the Request.url property, which this middleware modifies.

License

Licensed under the MIT, see LICENSE.


lib.rs:

Some simple BeforeMiddleware to make using Iron behind a reverse proxy easier.

use iron::prelude::*;
let mut ch = Chain::new(handler);
ch.link_before(iron_reverse_proxy::ReverseProxyMiddleware);

And you're done. Works particularly well with router's url_for! macro, as it depends on the Request.url property, which this middleware modifies.

Dependencies

~4.5MB
~114K SLoC