proxyparser 0.2.0

A cross-platform system proxy detector with strong support for complex enterprise PAC scripts
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// src/pac/mod.rs
pub mod downloader;
pub mod engine;

pub use engine::evaluate_pac_for_url;

/// 判断一个字符串是否像是 PAC 脚本 URL
pub fn is_pac_url(s: &str) -> bool {
    let lower = s.to_lowercase();
    lower.starts_with("file:")
        || lower.ends_with(".pac")
        || lower.ends_with(".dat")
        || lower.contains(".pac?")
        || lower.contains("proxy.pac")
        || lower.contains("wpad.dat")
}