Request via aiohttp proxy does not work (url is None) #1413
Description
Long story short
I tried to perform a request via http proxy, but the request via aiohtpp doesn't work, example is taken from official documentation, put a random proxy, and you get the same result
random proxy list http://hideme.ru/proxy-list/?ports=80#list
or
python proxy for test https://github.com/abhinavsingh/proxy.py
Expected behaviour
curl --proxy 163.172.177.100:80 -I http://httpbin.org/
HTTP/1.1 200 OK
Server: nginx
Date: Sun, 20 Nov 2016 14:02:24 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 12150
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
X-Cache: MISS from apocas
X-Cache-Lookup: MISS from apocas:80
Via: 1.1 apocas (squid/3.3.8)
Connection: keep-alive
status 200
Actual behaviour
proxy response: status 400 - Invalid URL / Some aspect of the requested URL is incorrect.
Steps to reproduce
import asyncio
import aiohttp
async def go():
async with aiohttp.ClientSession() as session:
async with session.get("http://httpbin.org/",
proxy="http://163.172.177.100:80") as resp:
print(resp.status)
loop = asyncio.get_event_loop()
loop.run_until_complete(go())
loop.close()
Your environment
tried on both python 3.5.2 and python 3.6 (latest)
aiohttp (1.1.5)
Debug
I turned on my proxy, look at the results
curl
2016-11-20 18:30:54,049 - INFO - pid:24748 - 127.0.0.1:33562 - b'HEAD' b'httpbin.org':80b'/' - b'200' b'OK' - 225 bytes
aiohttp:
2016-11-20 18:30:07,162 - INFO - pid:20625 - 127.0.0.1:33548 - b'GET' None:80b'/' - None None - 0 bytes