Open strongbugman opened 6 years ago
Reopen with more detail.
I find that the second request do not have proxy auth header(for http request, https request is fun), so I can do like this:
s = aiohttp.ClientSession()
proxy = 'http://name:passwd@one_proxy_with_auth'
async with s.request('GET', 'http://httpbin.org', proxy=proxy) as res:
await res.read()
print(res.status) # print 200
async with s.request('GET', 'http://httpbin.org', proxy=proxy, headers={'PROXY_AUTHENTICATE': 'Basic authstr'}) as res:
await res.read()
print(res.status) # print 200
await s.close()
Long story short
Only first proxy auth is fun when sending many http`s requests(with same proxy and same url location) through one client session
Expected behaviour
Request same url with same authed proxy many times in one client session, proxy auth will work for all requests
Actual behaviour
Request same url with same authed proxy many times in one client session, only first request is fun, others will return 407 HTTP status code which mean the proxy auth not work(No proxy auth in the requests HTTP headers).
Steps to reproduce
There is a example code:
Your environment
aiohttp: 3.3.1 as client OS: MacOS 10.13.1 proxy: squid