1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
# env_proxy
[](https://travis-ci.org/inejge/env_proxy)
Determination of proxy parameters for a URL from the environment.
See the [documentation](https://inejge.github.io/env_proxy) for API reference.
## Getting Started
Add the following to the `[dependencies]` section of your `Cargo.toml`:
```toml
env_proxy = "0.3"
```
Also, import the crate in your crate root:
```rust
extern crate env_proxy;
```
## Example
```rust
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);
}
```
## License
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](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT).
|