在Python
中…
算了不废话了,直接上代码
pip install aiohttp aiohttp_socks
import asyncio
import aiohttp
import aiohttp_socks
async def main():
proxies = "socks5://localhost:10808"
conn = aiohttp_socks.ProxyConnector.from_url(proxies)
async with aiohttp.ClientSession(connector=conn) as session:
url = "https://ipapi.co/json"
async with session.get(url) as response:
print(response.status)
print(await response.text())
asyncio.run(main())
一眼明了,不耽误大家时间~!