You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think the code to get a list of proxies should be as simple as possible. So just make something like proxies = Broker.get_proxies(n). Maybe an optional parameter with the format of the strings.
def getProxies(n: int) -> List[str]:
'''Return a list of n working proxies
'''
async def show(proxies):
p = []
while True:
proxy = await proxies.get()
if proxy is None: break
p.append(f'{proxy.host}:{proxy.port}')
return p
proxies = asyncio.Queue()
broker = Broker(proxies)
tasks = asyncio.gather(broker.find(types=['HTTPS'], limit=n), show(proxies))
loop = asyncio.get_event_loop()
return loop.run_until_complete(tasks)[1]
The text was updated successfully, but these errors were encountered:
I think the code to get a list of proxies should be as simple as possible. So just make something like
proxies = Broker.get_proxies(n)
. Maybe an optional parameter with the format of the strings.The text was updated successfully, but these errors were encountered: