# -*- coding: utf-8 -*-
import asyncio
import aiohttp
import requests
'''requests'''
res = requests.get('https://icanhazip.com', proxies={'http': 'http://36.249.119.38:9999'})
print(res.text)
print("async......")
async def func1(): # async
async with aiohttp.ClientSession() as session:
async with session.get("https://icanhazip.com", proxy='http://36.249.119.38:9999') as r:
print('---------------------------------')
print(await r.text())
asyncio.run(func1())
113.118.175.175
async......
.....aiohttp.client_exceptions.ClientProxyConnectionError: Cannot connect to host 36.249.119.38:9999 ssl:default [Connect call failed ('36.249.119.38', 9999)]