8 releases

new 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

#74 in HTTP client

Download history 94/week @ 2022-11-27 7/week @ 2022-12-04 5/week @ 2022-12-11 1/week @ 2022-12-18 1/week @ 2022-12-25 27/week @ 2023-01-01 1/week @ 2023-01-08 7/week @ 2023-01-15 9/week @ 2023-01-22 7/week @ 2023-01-29 8/week @ 2023-02-05 11/week @ 2023-02-12 4/week @ 2023-02-19 36/week @ 2023-02-26 2/week @ 2023-03-05 81/week @ 2023-03-12

127 downloads per month

MPL-2.0 license

32KB
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.5–9.5MB
~205K SLoC