4 releases

0.1.3 Dec 12, 2024
0.1.2 Nov 28, 2024
0.1.1 Apr 3, 2024
0.1.0 Jan 5, 2021

#402 in HTTP server

Download history 30186/week @ 2025-08-28 27841/week @ 2025-09-04 29792/week @ 2025-09-11 29089/week @ 2025-09-18 32123/week @ 2025-09-25 29866/week @ 2025-10-02 32567/week @ 2025-10-09 32783/week @ 2025-10-16 33020/week @ 2025-10-23 40502/week @ 2025-10-30 33535/week @ 2025-11-06 39206/week @ 2025-11-13 42914/week @ 2025-11-20 37261/week @ 2025-11-27 44919/week @ 2025-12-04 27931/week @ 2025-12-11

159,277 downloads per month
Used in 231 crates (6 directly)

MIT/Apache

16KB
388 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)
    }
}

no_std

This 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.

Dependencies

~31KB