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

#209 in HTTP client

Download history 126/week @ 2023-12-11 101/week @ 2023-12-18 56/week @ 2023-12-25 168/week @ 2024-01-01 139/week @ 2024-01-08 217/week @ 2024-01-15 149/week @ 2024-01-22 95/week @ 2024-01-29 172/week @ 2024-02-05 97/week @ 2024-02-12 114/week @ 2024-02-19 132/week @ 2024-02-26 85/week @ 2024-03-04 249/week @ 2024-03-11 141/week @ 2024-03-18 119/week @ 2024-03-25

615 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
~234K SLoC