real-ip
Get the "real-ip" of an incoming request using the "forwarded", "x-forwarded-for" or "x-real-ip" headers set by reverse proxies.
See the crate documentation for more details and examples.
Example
use Request;
use IpAddr;
use ;
// in a real program this info would of course come from the http server
let incoming_ip = from;
let request = builder.header.body.unwrap;
// the reverse-proxies in our network that we trust
let trusted_proxies = ;
let client_ip = real_ip;
assert_eq!;