Merge pull request #328 from c13/master

check enviroment for https_proxy
This commit is contained in:
Alexey Lavrenuke 2017-02-20 17:23:37 +02:00 committed by GitHub
commit b75eb8a9fe

View File

@ -19,6 +19,11 @@ class OverloadClient(object):
self.session = requests.Session()
self.session.verify = False
self.session.headers.update({"User-Agent": "tank"})
if "https" in requests.utils.getproxies():
logger.info("Connecting via proxy %s" % requests.utils.getproxies()['https'])
self.session.proxies = requests.utils.getproxies()
else:
logger.info("Proxy not set")
def set_api_address(self, addr):
self.address = addr