A duplicate of this question, but I think it might have changed in 2 years.
I am trying to use a socks4 proxy with aiohttps ClientSession.get
, by specifying the proxy
kwarg (not the connector
kwarg in ClientSession
as I am changing the proxy frequently) and I was wondering how to do that. I am pretty sure I have to use something like aiohttp-socks but they don't provide a lot of documentation.
This is what I have tried
async with aiohttp.ClientSession() as session:
async with session.get(url, proxy='socks4://188.165.138.11:54430') as r:
data = await r.json()
....
# gives ValueError: Only http proxies are supported
question from:
https://stackoverflow.com/questions/65642594/how-to-use-socks4-proxy-with-aiohttp 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…