add ssl proxy support to browser and browser2 and add the option _proxy_ssl
This commit is contained in:
parent
a56767fbf5
commit
0f1726d01c
3 changed files with 26 additions and 14 deletions
|
|
@ -223,15 +223,8 @@ class StandardBrowser(mechanize.Browser):
|
|||
|
||||
# Use a proxy
|
||||
self.proxy = proxy
|
||||
if proxy:
|
||||
proto = 'http'
|
||||
if '://' in proxy:
|
||||
v = urlsplit(proxy)
|
||||
proto = v.scheme
|
||||
domain = v.netloc
|
||||
else:
|
||||
domain = proxy
|
||||
self.set_proxies({proto: domain})
|
||||
if proxy is not None:
|
||||
self.set_proxies(proxy)
|
||||
|
||||
# Share cookies with firefox
|
||||
if firefox_cookies and HAVE_COOKIES:
|
||||
|
|
@ -481,7 +474,7 @@ class BaseBrowser(StandardBrowser):
|
|||
does not keep history
|
||||
:type history: object
|
||||
:param proxy: proxy URL to use
|
||||
:type proxy: str
|
||||
:type proxy: dictionnary
|
||||
:param logger: logger to use for logging
|
||||
:type logger: :class:`logging.Logger`
|
||||
:param factory: mechanize factory. None to use Mechanize's default
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue