Open madrassomrn opened 4 months ago
@madrassomrn To get around this issue I would try using the aiohttp_socks
library for now, I will be sure to implement the solution directly for this problem without the workaround I have provided to you in the future.
@madrassomrn To get around this issue I would try using the
aiohttp_socks
library for now, I will be sure to implement the solution directly for this problem without the workaround I have provided to you in the future.
With this library, I can’t change the proxy per request, or is it not possible there?
@madrassomrn it's not possible to swap proxies without disconnecting from one and then swapping however, I am planning though to write a test to the tests folder for hosing a temporary http proxy to attempt to make a request from to make sure winloop knows how to handle this stuff correctly on aiohttp itself so I can see where the problem exactly is coming from.
env_.venv\Lib\site-packages\aiohttp\connector.py:942: RuntimeWarning: An HTTPS request is being sent through an HTTPS proxy. This support for TLS in TLS is known to be disabled in the stdlib asyncio (Python <3.11). This is why you'll probably see an error in the log below.
It is possible to enable it via monkeypatching. For more details, see:
You can temporarily patch this as follows:
https://github.com/aio-libs/aiohttp/discussions/6044
_, proto = await self._create_proxy_connection(req, traces, timeout) RuntimeWarning: Enable tracemalloc to get the object allocation traceback Exception in callback <bound method SSLProtocol.connection_made of <winloop.loop.SSLProtocol object at 0x00000278E76A6AE0>>
Connecting to an https site via an http proxy, how to fix this error?