9 class ProxyScanner(threading
.Thread
):
10 def __init__(self
, proxy
):
11 threading
.Thread
.__init
__(self
)
15 d
= urllib
.urlencode({ "ppcheck": "ppcheck"}) # Check for POST support.
16 u
= urllib
.urlopen(checker
, d
, { "http": "http://" + self
.proxy
})
17 except KeyboardInterrupt:
22 result
= u
.readline().strip()
26 checker
= "http://www.example.net/check.cgi" # Use a hostname as some proxies don't do DNS.
35 print "Couldn't open %s." % sys
.argv
[1]
38 socket
.setdefaulttimeout(20)
42 while threading
.activeCount() == numthreads
:
44 thread
= ProxyScanner(l
.strip())
46 except KeyboardInterrupt: