views:

112

answers:

1

i wrote this code :

import random
import sys
import urllib
openfile = open(sys.argv[1]).readlines()
c = random.choice(openfile)
i = 0
while i < 5:
 i=i+1
 c = random.choice(openfile)
 proxies = {'http': c}
 opener = urllib.FancyURLopener(proxies).open("http://whatismyip.com.au/").read()

::: I put 3 proxy in a txt file . :

http://211.161.159.74:8080
http://119.70.40.101:8080
http://124.42.10.119:8080

but when execute it i get this error :

IOError: [Errno socket error] (10054, 'Connection reset by peer')

what am i going to do ? please help me .

+2  A: 

The first proxy you list is giving my telnet an ECONNRESET too. What makes you think these are valid proxies? Incidentally, if you are trying to find out their DNS names, they don't have any.

$ dig -x  211.161.159.74 
;; connection timed out; no servers could be reached
msw