C
C
Coder 14482022-02-06 21:27:21
Python
Coder 1448, 2022-02-06 21:27:21

Why is proxy checking more stable over streams than async?

Testing lists of proxies. There are ~5 times more valid proxies found with the threading and requests modules than with asyncio and aiohttp. Why is this happening? The timeout is the same. Everywhere one session on 1 request is created. The same list. I check not at the same time by two methods.

aio http code: https://pastebin.com/dWwgtTW2
requests code: https://pastebin.com/Xs8QAGgL

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Ilinykh, 2022-02-10
@wows15

Because in async you can't be sure which proxy the next request is going through. Yes, it supports proxies but for all Requests. As a result, you send 10 proxies for verification, and in fact only one is checked, which is why there is such a large percentage of failures. To check proxies, each request must be isolated.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question