| Crates.io | system_proxy |
| lib.rs | system_proxy |
| version | 0.3.2 |
| created_at | 2022-03-14 20:51:37.901514+00 |
| updated_at | 2023-03-12 17:36:13.951151+00 |
| description | Get the system-wide HTTP proxy |
| homepage | https://github.com/swsnr/system_proxy.rs |
| repository | https://github.com/swsnr/system_proxy.rs.git |
| max_upload_size | |
| id | 550167 |
| size | 102,403 |
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.
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.