| Crates.io | rfc7239 |
| lib.rs | rfc7239 |
| version | 0.1.3 |
| created_at | 2021-01-05 20:40:05.41365+00 |
| updated_at | 2024-12-12 20:51:07.575288+00 |
| description | Parser for rfc7239 formatted Forwarded headers |
| homepage | |
| repository | https://github.com/icewind1991/rfc7239 |
| max_upload_size | |
| id | 332444 |
| size | 18,485 |
Parser for rfc7239 formatted Forwarded headers.
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)
}
}
no_stdThis crate can be used in a no_std environment by disabling the default std feature.
The only impact disabling this feature has is using core::error::Error and core::net::IpAddr instead of the std variants and increasing the msrv to 1.81.