from aiohttp_proxy import ProxyConnector
import aiohttp
ssl_conn = aiohttp.TCPConnector(ssl=ssl_context)
proxy_conn = ProxyConnector.from_url(url=session_proxy) if session_proxy else None
async with aiohttp.ClientSession(
connector=ssl_conn,
headers={
**headers,
}) as client:
class ProxyConnector(TCPConnector):
def __init__(
self, ...,
**kwargs
):
...
super().__init__(**kwargs)
...