8 releases

0.3.2 Mar 12, 2023
0.3.1 Mar 12, 2023
0.2.0 Mar 2, 2023
0.1.3 Dec 1, 2022
0.1.1 Mar 16, 2022

#89 in #http-proxy

Download history 76/week @ 2024-11-10 183/week @ 2024-11-17 129/week @ 2024-11-24 172/week @ 2024-12-01 228/week @ 2024-12-08 331/week @ 2024-12-15 162/week @ 2024-12-22 93/week @ 2024-12-29 337/week @ 2025-01-05 454/week @ 2025-01-12 390/week @ 2025-01-19 203/week @ 2025-01-26 127/week @ 2025-02-02 1/week @ 2025-02-09

135 downloads per month

MPL-2.0 license

34KB
537 lines

system_proxy.rs

Current release Documentation

Resolve system HTTP(S) proxies for URLs.

let proxy = system_proxy::default();
let client = reqwest::blocking::Client::builder()
    .user_agent(concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")))
    .proxy(reqwest::Proxy::custom(move |u| proxy.for_url(u)))
    .build()
    .unwrap();

let response = client.get("https://httpbin.org/status/200").send().unwrap();
println!("Status code: {}", response.status());

See the module level documentation for more information.

License

Copyright 2022 Sebastian Wiesner sebastian@swsnr.de

This Source Code is subject to the terms of the Mozilla Public License, v. 2.0. See LICENSE or https://mozilla.org/MPL/2.0/ for a copy of the license.

Dependencies

~2–16MB
~234K SLoC