NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
import asyncio | |
import aiohttp | |
import aiosocks | |
from aiosocks.connector import ProxyConnector, ProxyClientRequest | |
async def main(): | |
async with aiohttp.ClientSession() as session: | |
async with session.get('http://icanhazip.com/') as resp: |