PyGithub icon indicating copy to clipboard operation
PyGithub copied to clipboard

Added support for http/s proxies

Open slastrina opened this issue 3 years ago • 0 comments

Added support for proxies servers. Useful for organisations that enforce IP whitelisting to internal IP's (VPN excluded). The Github object has been enhanced to include proxies as a kwarg, the proxies arg expects a dictionary and is a passthrough for the standard requests library way of implementing proxies (https://docs.python-requests.org/en/latest/api/#requests.Session.proxies) i.e.

proxies = { 
              "http"  : http_proxy, 
              "https" : https_proxy, 
              "ftp"   : ftp_proxy
            }

Usage:

proxy_dict = { 
              "https"  :'http://username:[email protected]:80',
            }
g = Github("access_token", proxies=proxy_dict)

slastrina avatar May 12 '22 08:05 slastrina