system_proxy

Crates.iosystem_proxy
lib.rssystem_proxy
version0.3.2
sourcesrc
created_at2022-03-14 20:51:37.901514
updated_at2023-03-12 17:36:13.951151
descriptionGet the system-wide HTTP proxy
homepagehttps://github.com/swsnr/system_proxy.rs
repositoryhttps://github.com/swsnr/system_proxy.rs.git
max_upload_size
id550167
size102,403
Sebastian Wiesner (swsnr)

documentation

https://docs.rs/system_proxy

README

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.

Commit count: 53

cargo fmt