[Bug] Missing HTTP Proxy Setting
MovisLi opened this issue · 1 comments
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
- Refer to other enviroment variables, I think
HTTP_PROXY
orHTTPS_PROXY
should found inopenbb_core/env.py
. However it isn't. - Then I check the session definition file
openbb_core/utils/client.py
, there is a class namedClientSession
, but it don't useproxies
parameter durning initialization. - Then I check the request tool function
amake_request
,make_request
in fileopenbb_core/provider/utils/helpers.py
, it also doesn't useproxies
parameter.
So, is HTTP_PROXY
and HTTPS_PROXY
deprecated?
Screenshots
openbb_core/provider/utils/helpers.py
Desktop (please complete the following information):
- OS: Windows 11
- Python version 3.11.9
Additional context
Thanks for answering my problem.
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