def _get_proxy(self):
url_dissected = url_dissector.findall(
self.session['proxy']
)
if url_dissected and len(url_dissected[0]) == 3:
protocol, host, port = url_dissected[0]
if protocol == 'socks5':
return (socks.PROXY_TYPE_SOCKS5, host, int(port))
if protocol == 'socks4':
return (socks.PROXY_TYPE_SOCKS4, host, int(port))
if protocol.startswith('http'):
return (socks.PROXY_TYPE_HTTP, host, int(port))
return None, None, None
评论列表
文章目录