2个版本

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

#133 in HTTP服务器

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

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