Verifying https proxies at high speed
#1
Simple script, loading proxy ip:port from a file, and output the active proxies using multiple threads
script uses urllib2 requests

execute : python script.py proxyfile

Code:
#!/usr/bin/python
import os
import sys
import time
import urllib2
import thread

def checkproxy(proxyurl):
   try:
      timeout = 5
      check = 'https://google.com'
      proxyip= proxyurl
      proxy = urllib2.ProxyHandler({'https': proxyip})
      req = urllib2.build_opener(proxy)
      req.addheaders = [('User-Agent','Mozilla/5.0 (Windows NT 10.0; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0')]
      response = req.open(check, timeout=timeout)
      myfile = response.read()
      if "google" in myfile:
         print proxyurl
   except:
      m = 0 # bogus variable

def readproxyfile(filename):
   f = open(filename, 'r')
   x = f.read().splitlines()
   used = set(x)
   for all in used:
      try:
         time.sleep(0.01) # set the speed
         adding = 'https://'
         proxyurl = adding + all
         thread.start_new_thread(checkproxy, (proxyurl,) )
      except:
         print "thread errors"
   time.sleep(60) # wait for results

filename = sys.argv[1]
readproxyfile(filename)
Reply


Messages In This Thread
Verifying https proxies at high speed - by illmanors - 09-16-2018, 11:23 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Chrome Botnet Proxies Insider 3 22,049 02-20-2021, 06:01 PM
Last Post: ueax
  GPing, a program that shows your network speed but with a graph. (made with Python) Beau 2 12,747 03-10-2016, 05:16 AM
Last Post: Psycho_Coder