-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add support for http_proxy environment variable #529
Comments
I'm surprised aiohttp doesn't do this already.
I think handling |
IIRC, requests does handle http{,s}_proxy environment variables: |
@aeroevan that sounds strange because I cannot find |
Also,
https://docs.python.org/3/library/urllib.request.html#module-urllib.request |
@wrobell urllib is not the best example. |
@asvetlov I think they build the environment variable lookup programmatically based on protocol to get HTTPS_PROXY, FTP_PROXY, etc. |
@asvetlov Sorry, but I still don't get it. |
Hi @qsz13, using proxy settings fetched from env will work in a one single case -- when you use all defaults (I mean Anyway, |
I don't want to relay on environment variables by default but adding a function like |
It's a shame that aiohttp is not compatible with a def-facto standard environment variable |
@ashald could you please describe your use case? why suggested |
@jettify well, yeah, indeed, |
-10 for implicit environment variables usage. Period. |
That's why I said it's a shame such an OSS project is being driven by subjective opinions rather than wide-spread practices and standards. Anyway, thanks for spending your time to explain that this feature is not going to be implemented in |
Python itself is driven by subjective opinions of Python Core Developers and it's leader Guido van Rossum especially. |
Java supports HTTP proxy properties (that would be equivalent of the environment variables) - HTTP client in Go language seems to support the |
It seems we can simply use now
to pull proxy configuration from environment variables? |
Yes, exactly. |
This is perfect, thank you. |
This works fine unless you don't use no_proxy env which is is ignored. I would suggest to reopen this issue and provide the full fix. |
Please make a pull request |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs. |
A lot of software is checking for "http_proxy" env variable and if it exists, then it uses the proxy specified in the variable.
Would it be possible to add appropriate code in
aiohttp.request
or should each software using aiohttp do it on its own?The text was updated successfully, but these errors were encountered: