示例#1
0
文件: proxy.py 项目: greshem/splash
 def __init__(self, proxy):
     url = urlparse.urlparse(proxy)
     if url.scheme and url.scheme in ('http', 'socks5') and url.hostname:
         self.proxy = create_proxy(url.hostname,
                                   url.port or 1080,
                                   username=url.username,
                                   password=url.password,
                                   type=url.scheme.upper())
     else:
         _raise_proxy_error('Invalid proxy URL format.')
示例#2
0
 def __init__(self, proxy):
     url = urlparse(proxy)
     if url.scheme and url.scheme in ('http', 'socks5') and url.hostname:
         self.proxy = create_proxy(
             url.hostname,
             url.port or 1080,
             username=url.username,
             password=url.password,
             type=url.scheme.upper()
         )
     else:
         _raise_proxy_error('Invalid proxy URL format.')
示例#3
0
 def set_proxy(self, host, port, username=None, password=None, type='HTTP'):
     proxy = create_proxy(host, port, username, password, type)
     self.request.custom_proxy = proxy
示例#4
0
 def set_proxy(self, host, port, username=None, password=None, type='HTTP'):
     proxy = create_proxy(host, port, username, password, type)
     self.request.custom_proxy = proxy
示例#5
0
文件: proxy.py 项目: greshem/splash
 def _get_custom_proxy_list(self):
     return [
         create_proxy(host, port, username, password, type)
         for host, port, username, password, type in self.proxy_list
     ]
示例#6
0
 def _get_custom_proxy_list(self):
     return [
         create_proxy(host, port, username, password, type)
         for host, port, username, password,type in self.proxy_list
     ]
示例#7
0
文件: proxy.py 项目: 0xmilk/splash
 def _customProxyList(self):
     return [
         create_proxy(host, port, username, password)
         for host, port, username, password in self.proxy_list
     ]
示例#8
0
文件: proxy.py 项目: kfei/splash
 def _customProxyList(self):
     return [
         create_proxy(host, port, username, password)
         for host, port, username, password in self.proxy_list
     ]