Python Forum
Proxy Checking Software Error
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Proxy Checking Software Error
#1
Hey guys i have this code that i have been working on and all it does is checks if a proxy is valid or not. Though it produces no error, it dosent seem to be working because when i add bad proxies on purpose it still prints out as if it is working. im not sure why this is the case and would appreciate some help.

def check_proxies():
    print('[#] Checking proxies now ')
    def check_proxies(proxy):
        try:
            r = requests.get('https://www.test.com/', proxies={'http':proxy}, timeout=3)
            if r.status_code == 200:
                fproxy.append(proxy)
                print(Fore.GREEN + 'Working proxy --> ', proxy)
            else:
                print(Fore.RED + 'Not working proxy --> ', proxy)
                pass
        except TimeoutError:
            pass
        except ConnectionError:
            pass
    def proxies(proxy):
        with concurrent.futures.ThreadPoolExecutor(max_workers=30) as executor:
            executor.map(check_proxies, proxy)
    proxies(proxy)
buran write Jan-19-2021, 08:54 AM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Reply


Messages In This Thread
Proxy Checking Software Error - by rizzla - Jan-19-2021, 08:47 AM
RE: Proxy Checking Software Error - by buran - Jan-19-2021, 09:06 AM
RE: Proxy Checking Software Error - by rizzla - Jan-19-2021, 09:16 AM
RE: Proxy Checking Software Error - by buran - Jan-19-2021, 09:32 AM
RE: Proxy Checking Software Error - by rizzla - Jan-19-2021, 09:38 AM
RE: Proxy Checking Software Error - by rizzla - Jan-19-2021, 09:40 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Error while checking for key in Dictionary onenessboy 5 3,928 Aug-14-2020, 01:06 PM
Last Post: onenessboy

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020