rfc7239

Crates.iorfc7239
lib.rsrfc7239
version
sourcesrc
created_at2021-01-05 20:40:05.41365
updated_at2024-12-12 20:51:07.575288
descriptionParser for rfc7239 formatted Forwarded headers
homepage
repositoryhttps://github.com/icewind1991/rfc7239
max_upload_size
id332444
Cargo.toml error:TOML parse error at line 19, column 1 | 19 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Robin Appelman (icewind1991)

documentation

https://docs.rs/rfc7239

README

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.

Commit count: 11

cargo fmt