system_proxy 0.3.0

Get the system-wide HTTP proxy
docs.rs failed to build system_proxy-0.3.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: system_proxy-0.3.2

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.