I was wondering if it is possible to run threads each with its own environment variables.
I am currently using environment variables to set my proxies like this:
os.environ["HTTP_PROXY"] = proxy["http"]
os.environ["HTTPS_PROXY"] = proxy["https"]
But I noticed that each thread will just use the proxy that has last been set. It is not possible for me to use the requests library for this purpose.
Is there a way that I can achieve this without using requests.Session()
for each thread?