Closed martinmose closed 1 week ago
Hi, it's not a bug from Proxyman. It's how the reqwest
lib works. By default, the reqwest
doesn't use any proxy, so Proxyman can't capture it automatically.
reqwest
http://localhost:9090
reqwest
doesn't trust Proxyman self-signed certificate, so you might get SSL Error when Proxyman tries to decrypt it.If it's from Ruby, Python or NodeJS, Proxyman has the Auto Setup tool, but not for Rust.
I haven't supported it yet, so we have to manually do it.
Hi,
I wasn't sure how to classify this "issue", so I chose to label it as a bug. 😅
Thank you very much for the helpful information! We can definitely work around that. I can confirm that it works if I do the following:
use anyhow::Result;
use reqwest::Url;
#[tokio::main]
async fn main() -> Result<()> {
let proxy_url = Url::parse("http://localhost:9090")?;
let client = reqwest::Client::builder()
.danger_accept_invalid_certs(true)
.proxy(reqwest::Proxy::https(proxy_url)?)
.build()?;
let response = client.get("https://httpbin.org/get").send().await?;
if response.status().is_success() {
let body = response.text().await?;
println!("Response Text: {}", body);
} else {
println!("Request failed with status: {}", response.status());
}
Ok(())
}
Thanks, I will update our Documentation to make Proxyman work with Rust + Reqwest 🙇
Description
First and foremost, thank you for an excellent piece of software! My colleagues and I use Postman extensively in our development workflow for native iOS/Android apps. Recently, we've started integrating Rust alongside Swift/Kotlin, primarily using Rust for handling network tasks. For HTTP client functionality, we rely on the popular
reqwest
crate.To avoid dealing with OpenSSL, we've switched to using
rustls-tls
. OurCargo.toml
configuration looks like this:However, after this change, we no longer see any traffic in Proxyman. We would greatly appreciate it if this could be supported again. It might be an edge case (apologies for that), but I'm posting this issue to see if there's something obvious we've missed.
Steps to Reproduce
main.rs
:Cargo.toml
:Current Behavior
No traffic appears in Proxyman.
Expected Behavior
When the Cargo.toml is configured like this:
We see the request in Proxyman.
Environment