-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
I'm trying to connect to localhost's IPv6 address (::1) via a SOCKS5 proxy using reqwest. The code below works perfectly fine on Windows, but fails on Linux with
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error(Hyper(Error(Connect, Custom { kind: Other, error: "failed to lookup address information: Name or service not known" })), "http://[::1]:8080/")', src/libcore/result.rs:999:5
.
The code in question:
use reqwest;
fn main() {
let proxy_uri = "socks5://127.0.0.1:1080";
let proxy = reqwest::Proxy::all(proxy_uri).expect("Failed to convert proxy address");
let client = reqwest::ClientBuilder::new().proxy(proxy).build().unwrap();
let dest_url = format!("http://[::1]:{}", 8080);
let mut resp = client.get(&dest_url).send().unwrap();
}Metadata
Metadata
Assignees
Labels
No labels