mirror of
https://codeberg.org/icewind/real-ip.git
synced 2026-06-03 17:44:06 +02:00
readme
This commit is contained in:
parent
7ac15c9193
commit
6f3a1977bc
3 changed files with 35 additions and 5 deletions
11
src/lib.rs
11
src/lib.rs
|
|
@ -1,10 +1,6 @@
|
|||
//! Get the "real-ip" of an incoming request.
|
||||
//!
|
||||
//! This uses the "forwarded", "x-forwarded-for" or "x-real-ip" headers set by reverse proxies.
|
||||
//! To stop clients from abusing these headers, only headers set by trusted remotes will be accepted.
|
||||
//!
|
||||
//! Note that if multiple forwarded-for addresses are present, which can be the case when using nested reverse proxies,
|
||||
//! all proxies in the chain have to be within the list of trusted proxies.
|
||||
//!
|
||||
//! ## Trusted proxies
|
||||
//!
|
||||
|
|
@ -13,6 +9,9 @@
|
|||
//!
|
||||
//! Trusted proxies are configured as a list of [`IpNetwork`]s, which can be a single ip or an ip range.
|
||||
//!
|
||||
//! Note that if multiple forwarded-for addresses are present, which can be the case when using nested reverse proxies,
|
||||
//! all proxies in the chain have to be within the list of trusted proxies.
|
||||
//!
|
||||
//! ## Examples
|
||||
//!
|
||||
//! A request originating from 192.0.2.1, being proxied through 10.10.10.10 and 10.0.0.1 before reaching our program
|
||||
|
|
@ -169,3 +168,7 @@ fn maybe_bracketed(x: &str) -> &str {
|
|||
x
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[doc = include_str!("../README.md")]
|
||||
fn test_readme_examples() {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue