allow the default proxy to be overridden

This commit is contained in:
Damien Elmes 2012-05-20 18:29:43 +09:00
parent cbb472712b
commit e644cc1faa

View file

@ -15,10 +15,12 @@ from hooks import runHook
# syncing vars # syncing vars
HTTP_CERTS = os.path.join(os.path.dirname(__file__), "ankiweb.certs") HTTP_CERTS = os.path.join(os.path.dirname(__file__), "ankiweb.certs")
HTTP_TIMEOUT = 30 HTTP_TIMEOUT = 30
HTTP_PROXY = None
def httpCon(): def httpCon():
return httplib2.Http( return httplib2.Http(
timeout=HTTP_TIMEOUT, ca_certs=HTTP_CERTS, timeout=HTTP_TIMEOUT, ca_certs=HTTP_CERTS,
proxy_info=HTTP_PROXY,
# python2 doesn't support SNI # python2 doesn't support SNI
disable_ssl_certificate_validation="beta" in SYNC_URL) disable_ssl_certificate_validation="beta" in SYNC_URL)