ureq
ureq copied to clipboard
Automatically pick up SOCKS configuration from environment variables
As discussed in #298, HTTP and SOCKS proxy configuration is not currently detected automatically based on environment variables. I feel this goes against the crate's stated goals somewhat, since the README says
Ureq's first priority is being easy for you to use.
and most other Rust clients that support SOCKS also automatically pick up its configuration from an environment variable.
This makes sense to me. 👍🏻
Sure. Let's do it.
Which environment variables should be supported http_proxy, https_proxy? More: https://gist.github.com/yougg/5d2b3353fc5e197a0917aae0b3287d64 ? (In case I find time to look into it, knowing which environment variables will help :) )
It looks like https://crates.io/crates/env_proxy has already done research on how folks expect these env vars to work, so that might be a good place to start.
It looks like https://crates.io/crates/env_proxy has already done research on how folks expect these env vars to work, so that might be a good place to start.
If we were to use this crate, we have to have a URL in order to get the correct proxy from env vars(using env_proxy::for_url_str), which in our case is given in Request::new. Can(or should) there be a way to change the Agent's config when instantiating a new Request?
One other way I can think of is we store all the possible proxies in Agent and choose to use the correct one in Unit::connect_socket.
If this issue is still free, I want to try and take a stab at it. May need some guidance :)
I'm interested in this, @Dolpheyn did you give it a go?
Anyone looking at this? Can't be that hard to implement.
Yeah, I'm lucky I never had to work behind proxies, so from what I know no one picked it up.
I see that #649 is merged, is this problem solved?
(github might not have done the auto close without a "close" keyword in the pr?)
This was fixed in 2.8.0 (and I just released 2.9.0).
I believe this is done.