-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
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
Allow customization of internal HTTP client #47
Comments
Hi @jtaox , happy to know you found it useful. Can you elaborate more about the use case with custom reqwest/HTTP client? What customization would you like to do? I havent had to use a proxy yet, so your use case can help me understand better. |
@64bit sometimes you may have a misbehaving virtual machine that doesn't like certain IP addresses. In such case you can specify an HTTP proxy for |
@64bit In China, some websites are banned by the GFW, making it impossible to access them directly. Therefore, it's necessary to use a foreign server as a proxy to access these websites |
Aha glad you found a solution :) Thank you for contributing and sharing about GFW. I'll close this as it's resolved for you. |
While proxies may be set up by the means of environment variables, supporting custom middleware is still a thing :) For instance, there is a tracing middleware which enables the use of OpenTelemetry traces: https://crates.io/crates/reqwest-tracing |
Hi @TmLev , Your use case is different from the original need for it, but this issue is broad enough so I'll re-open this. For having middlewares on client side, I see more info on seanmonstar/reqwest#155 and https://truelayer.com/blog/adding-middleware-support-to-rust-reqwest/ So until |
I doubt Unfortunately, In the meantime, I did a small optimization (which was a low-hanging fruit, really): #58 |
Nice optimization!
|
Happy 1 year anniversary for this issue 😄 I think its safe to close it, seems like having feature to provide |
Hello! I'm using your library and I noticed that there's no option to customize the internal HTTP client used for API requests when calling Client::new(). This makes it impossible to implement a proxy for all HTTP requests.
I was wondering if it would be possible to add a customization option for the internal reqwest client, similar to what the chatgpt-api offer. This would allow for greater flexibility and more use cases for this library.
The text was updated successfully, but these errors were encountered: