2 releases
0.1.1 | Apr 3, 2024 |
---|---|
0.1.0 | Jan 5, 2021 |
#200 in Network programming
78,238 downloads per month
Used in 187 crates
(4 directly)
15KB
374 lines
rfc7239
Parser for rfc7239 formatted Forwarded
headers.
Usage
use rfc7239::parse;
// get the header value from your favorite http server library
let header_value = "for=192.0.2.60;proto=http;by=203.0.113.43,for=192.168.10.10";
for node_result in parse(header_value) {
let node = node_result?;
if let Some(forwarded_for) = node.forwarded_for {
println!("Forwarded by {}", forwarded_for)
}
}
lib.rs
:
Parser for rfc7239 formatted Forwarded
headers.
Usage
use rfc7239::parse;
// get the header value from your favorite http server library
let header_value = "for=192.0.2.60;proto=http;by=203.0.113.43,for=192.168.10.10";
for node_result in parse(header_value) {
let node = node_result?;
if let Some(forwarded_for) = node.forwarded_for {
println!("Forwarded by {}", forwarded_for)
}
}
Dependencies
~31KB