Skip to content

Instantly share code, notes, and snippets.

@zhangzhhz
Created April 8, 2020 08:12
Show Gist options
  • Save zhangzhhz/a310fcea3ea4a5c0d3e246a3faa28b16 to your computer and use it in GitHub Desktop.
Save zhangzhhz/a310fcea3ea4a5c0d3e246a3faa28b16 to your computer and use it in GitHub Desktop.
python program or PIP accessing internet via proxy
Set environment variables for proxies.
Windows:
set http_proxy=http://xxx.xxx.xxx.xxx:80
set https_proxy=http://xxx.xxx.xxx.xxx:80
Bash:
http_proxy=http://xxx.xxx.xxx.xxx:80
https_proxy=http://xxx.xxx.xxx.xxx:80
References:
https://blog.scrapinghub.com/python-requests-proxy
https://msal-python.readthedocs.io/en/latest/
PIP configuration:
```
[global]
proxy = http://xxx.xxx.xxx.xxx:80
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment