Story #1032 ยป threaded.py.patch
threaded.py 2015-06-04 17:08:13.895987873 -0400 | ||
---|---|---|
# Set session.proxies according to given url and port
|
||
protocol, remainder = urllib.splittype(config.proxy_url)
|
||
host, remainder = urllib.splithost(remainder)
|
||
# if protocol wasn't parsed, the url is most likely reduced to a host name
|
||
if protocol is None:
|
||
host = config.proxy_url
|
||
else:
|
||
host, remainder = urllib.splithost(remainder)
|
||
url = ':'.join((host, str(config.proxy_port)))
|
||
if config.proxy_username is not None:
|
||
... | ... | |
auth = config.proxy_username + password_part
|
||
url = '@'.join((auth, url))
|
||
session.proxies['https'] = '://'.join((protocol, url))
|
||
session.proxies['http'] = '://'.join((protocol, url))
|
||
if protocol is not None:
|
||
session.proxies['https'] = '://'.join((protocol, url))
|
||
session.proxies['http'] = '://'.join((protocol, url))
|
||
else:
|
||
session.proxies['http'] = 'http://' + url
|
||
session.proxies['https'] = 'https://' + url
|
||
# Set session.auth if proxy username is specified
|
||
if config.proxy_username is not None:
|