Crates.io | env_proxy |
lib.rs | env_proxy |
version | 0.4.1 |
source | src |
created_at | 2016-06-19 21:06:24.224176 |
updated_at | 2020-07-07 19:47:10.689115 |
description | Determination of proxy parameters for a URL from the environment |
homepage | https://github.com/inejge/env_proxy |
repository | https://github.com/inejge/env_proxy |
max_upload_size | |
id | 5427 |
size | 36,801 |
Determination of proxy parameters for a URL from the environment.
See the documentation for API reference.
Add the following to the [dependencies]
section of your Cargo.toml
:
env_proxy = "0.3"
Also, import the crate in your crate root:
extern crate env_proxy;
use url::Url;
let url = Url::parse("http://www.example.org").unwrap();
if let Some(proxy) = env_proxy::for_url(&url).host_port() {
println!("Proxy host: {}", proxy.0);
println!("Proxy port: {}", proxy.1);
}
This program is distributed under the terms of both the MIT license and the Apache License (Version 2.0), at your option.
See LICENSE-APACHE and LICENSE-MIT.