proxy/proxy.rs
1// Reimplementation of the proxy command line utitlity that comes with libproxy.
2
3extern crate libproxy;
4
5use libproxy::ProxyFactory;
6
7fn main() {
8 let mut args = std::env::args();
9 if args.len() != 2 {
10 println!("Usage: proxy <url>");
11 return;
12 }
13
14 let factory = ProxyFactory::new().unwrap();
15
16 for proxy in factory.get_proxies(&args.nth(1).unwrap()).unwrap() {
17 print!("{} ", proxy);
18 }
19 println!();
20}