2个版本

0.1.1 2024年4月3日
0.1.0 2021年1月5日

#133 in HTTP服务器

Download history • Rust 包仓库 11512/week @ 2024-04-26 • Rust 包仓库 11460/week @ 2024-05-03 • Rust 包仓库 14061/week @ 2024-05-10 • Rust 包仓库 12032/week @ 2024-05-17 • Rust 包仓库 11549/week @ 2024-05-24 • Rust 包仓库 12468/week @ 2024-05-31 • Rust 包仓库 12683/week @ 2024-06-07 • Rust 包仓库 15261/week @ 2024-06-14 • Rust 包仓库 16160/week @ 2024-06-21 • Rust 包仓库 13977/week @ 2024-06-28 • Rust 包仓库 17003/week @ 2024-07-05 • Rust 包仓库 16801/week @ 2024-07-12 • Rust 包仓库 16242/week @ 2024-07-19 • Rust 包仓库 16518/week @ 2024-07-26 • Rust 包仓库 16662/week @ 2024-08-02 • Rust 包仓库 13882/week @ 2024-08-09 • Rust 包仓库

66,735 每月下载量
169 个crate中使用了(直接使用3个)

MIT/Apache

15KB
374

rfc7239

rfc7239格式化的Forwarded头部的解析器。

用法

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:

rfc7239格式化的Forwarded头部的解析器。

用法

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)
    }
}

依赖

~31KB