4

When I try to make a request through an HTTPS proxy-

async with session.get(
    url
    headers={"k": v},
    proxy='https://my-proxy.com:1234',
) as response:
    resp_json = await response.json()

My request fails with the following exception:

raise ValueError("Only http proxies are supported")

This corresponds to the source code .

However, the docs say that HTTPS proxies are supported.

Is this an oversight in the docs or am I doing this incorrectly?

Ben
  • 5,952
  • 4
  • 33
  • 44

1 Answers1

5

I opened an issue in the repo and Andrew Svetlov was kind enough to clarify. aiohttp supports plain HTTP clients and HTTP clients that can be upgraded to HTTPS via HTTP CONNECT. I made a pull request to update the docs.

Ben
  • 5,952
  • 4
  • 33
  • 44