0x676e67 / reqwest-impersonate

An easy and powerful Rust HTTP / WebSocket Client

Home Page:https://github.com/seanmonstar/reqwest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using a proxy on MacOS will cause a timeout error

danepoirier0 opened this issue · comments

When I use the code .proxy(reqwest::Proxy::http("http://localhost:7890")?) to set a proxy, requesting certain URLs (http://chatgpt.com/) results in a timeout. When I comment out this line (and use the system proxy), I can access chatgpt.com normally.


OS: MacOs Monterey Ver 12.7.5
CPU: Intel
reqwest-impersonate Version: 0.11.84

When I run the code on Ubuntu, it correctly sets the proxy

Here is my codes:
`let client = reqwest::Client::builder()
.timeout(Duration::from_secs(9))
.proxy(reqwest::Proxy::http("http://localhost:7890")?)
.impersonate(Impersonate::Chrome120)
.danger_accept_invalid_certs(true)
.enable_ech_grease()
.permute_extensions()
.build()?;

let resp = client
.get("https://chatgpt.com/")
// .headers(headers)
.send().await?;
`

use reqwest::Proxy::all

thank you, it worked