def checker():
while True:
if proxyq.empty() is not True:
proxy = "http://{}".format( proxyq.get() )
url = "http://icanhazip.com"
proxy_handler = urllib2.ProxyHandler( { "http" : proxy } )
opener = urllib2.build_opener( proxy_handler )
urllib2.install_opener( opener )
printq.put( "[>] Trying {}".format( proxy ) )
try:
response = urllib2.urlopen( url, timeout=3 ).readlines()
for line in response:
if line.rstrip( "\n" ) in proxy:
printq.put( "[+] Working proxy: {}".format( proxy ) )
with open( "working.txt", "a" ) as log:
log.write( "{}\n".format( proxy ) )
log.close()
except Exception as ERROR:
printq.put( "[!] Bad proxy: {}".format( proxy ) )
proxyq.task_done()
评论列表
文章目录