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

#229 in HTTP client

Download history 145/week @ 2024-01-07 217/week @ 2024-01-14 147/week @ 2024-01-21 95/week @ 2024-01-28 156/week @ 2024-02-04 103/week @ 2024-02-11 122/week @ 2024-02-18 122/week @ 2024-02-25 90/week @ 2024-03-03 251/week @ 2024-03-10 143/week @ 2024-03-17 115/week @ 2024-03-24 121/week @ 2024-03-31 293/week @ 2024-04-07 122/week @ 2024-04-14 66/week @ 2024-04-21

612 downloads per month
Used in 2 crates (via mdcat)

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

~1–16MB
~223K SLoC