Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
162 views
in Technique[技术] by (71.8m points)

python 3.x - How to use socks4 proxy with aiohttp

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...