Hello today i posted some Socks5 proxies on a forum and some person went in discussion with me and said many of the proxies where "connect" proxies and socks4 proxies but i don't think my code is checking for any socks4 proxies:
def process(self, task):
global alive
global dead
global tested
proxy = task
ip,port = proxy.split(":")
socket.setdefaulttimeout(timeout_value)
log_msg = str("Trying Socks5 proxy%21s " % proxy)
socks.set_default_proxy(socks.SOCKS5, ip, int(port))
socket.socket = socks.socksocket
try:
t1 = time.time()
response = requests.get(test_url, timeout=timeout_value)
tested += 1
t2 = time.time()
except Exception as e:
log_msg += "%s " % fail_msg
print(Fore.LIGHTRED_EX + log_msg + " " + str(tested))
dead += 1
tested += 1
return None
if "Connection working" in response.text:
log_msg += ok_msg + "Response time: %d" % (int((t2-t1)*1000))
print(Fore.LIGHTGREEN_EX + log_msg)
text_file = open(out_filename, "a")
text_file.write(proxy + "\r\n")
text_file.close()
alive += 1
return proxy
else:
log_msg += "%s " % fail_msg
print(Fore.LIGHTRED_EX + log_msg + " " + str(tested))
dead += 1
tested += 1
return None
I don't know what i could be doing wrong, the person said he has been checking proxies since 2002 and he is the first person out of thousands to complain about it.