We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am trying to make reqwest run with socks5, I have enabled the feature and I can access the endpoint:
curl -k -x socks5h://localhost:1080 -H 'Authorization: Bearer --REDACTED--' https://api-gw-service-nmn.local/apis/ims/healthz/ready {}
My problem is that I can't make it to work in rust.
async fn main() -> Result<(), Box<dyn std::error::Error>> { let token = "--REDACTED--"; let url = "https://api-gw-service-nmn.local/apis/ims/healthz/ready"; let client = reqwest::Client::builder() .proxy(reqwest::Proxy::http("socks5://localhost:1080")?) .build()?; let resp = client.get(url).bearer_auth(token).send() .await? .json::<HashMap<String, String>>() .await?; println!("{:#?}", resp); Ok(()) }
This is the output I am getting:
Compiling rest-client v0.1.0 (/home/msopena/ownCloud/Documents/tests/rust/rest-client) Finished dev [unoptimized + debuginfo] target(s) in 5.36s Running `target/debug/rest-client` Error: reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("api-gw-service-nmn.local")), port: None, path: "/apis/ims/healthz/ready", query: None, fragment: None }, source: hyper::Error(Connect, ConnectError("dns error", Custom { kind: Uncategorized, error: "failed to lookup address information: Name or service not known" })) }
Any hint?
The text was updated successfully, but these errors were encountered:
Do you need the extra h in the scheme? socks5h://? I think that implies doing DNS on the proxy, right?
socks5h://
Sorry, something went wrong.
spot on!
No branches or pull requests
I am trying to make reqwest run with socks5, I have enabled the feature and I can access the endpoint:
My problem is that I can't make it to work in rust.
This is the output I am getting:
Any hint?
The text was updated successfully, but these errors were encountered: