aiohttp是否支持HTTPS代理

问题描述 投票:0回答:1

当我尝试通过HTTPS代理发出请求时-

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

我的请求失败,但有以下例外:

raise ValueError("Only http proxies are supported")

这对应于source code

但是,the docs说支持HTTPS代理。

这是文档中的疏忽还是我做错了?

python https proxy http-proxy aiohttp
1个回答
0
投票

[我在回购中打开了issue,Andrew Svetlov很友好地澄清了。 aiohttp支持纯HTTP客户端和可以通过HTTP CONNECT升级到HTTPS的HTTP客户端。我做了一个pull request来更新文档。

© www.soinside.com 2019 - 2024. All rights reserved.