Skip to content
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

[Bug] Missing HTTP Proxy Setting #6638

Closed
MovisLi opened this issue Aug 22, 2024 · 1 comment · Fixed by #6640
Closed

[Bug] Missing HTTP Proxy Setting #6638

MovisLi opened this issue Aug 22, 2024 · 1 comment · Fixed by #6640

Comments

@MovisLi
Copy link

MovisLi commented Aug 22, 2024

Describe the bug
I notice the document metioned Proxy Network in User Settings & Enviroment Variables, but I can't find this setting in source codes anywhere. So is there some thing wrong in the document or the codes?

To Reproduce

  1. Refer to other enviroment variables, I think HTTP_PROXY or HTTPS_PROXY should found in openbb_core/env.py. However it isn't.
  2. Then I check the session definition file openbb_core/utils/client.py, there is a class named ClientSession, but it don't use proxies parameter durning initialization.
  3. Then I check the request tool function amake_request, make_request in file openbb_core/provider/utils/helpers.py, it also doesn't use proxies parameter.

So, is HTTP_PROXY and HTTPS_PROXY deprecated?

Screenshots

Document
image

openbb_core/env.py File
image

openbb_core/utils/client.py
image

openbb_core/provider/utils/helpers.py
image

Desktop (please complete the following information):

  • OS: Windows 11
  • Python version 3.11.9

Additional context
Thanks for answering my problem.

@deeleeramone
Copy link
Contributor

Hi,

Thanks for the report. The issue arises from using both requests and aiohttp, and only requests reads the environment variables by default. I have added the necessary setting in the aiohttp.ClientSession initialization (#6640) to allow for the same behavior from all three HTTP IO helper functions - make_request, amake_request, and amake_requests - which should cover all HTTP requests throughout the library.

Note that the vast majority of requests will be HTTPS and not HTTP, but for full coverage define both addresses.

See: https://docs.python.org/3/library/urllib.request.html#urllib.request.getproxies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants