gpt4 book ai didi

proxy - 如何将 HTTP/HTTPS 代理与 boto3 一起使用?

转载 作者:行者123 更新时间:2023-12-02 03:57:33 24 4
gpt4 key购买 nike

关于旧的boto库很简单,可以使用 proxy , proxy_port , proxy_userproxy_pass打开连接时的参数。但是,我在 boto3 上找不到以编程方式定义代理参数的任何等效方法。 :(

最佳答案

至少从版本 1.5.79 开始,botocore 在 botocore 配置中接受 proxies 参数。

例如

import boto3
from botocore.config import Config

boto3.resource('s3', config=Config(proxies={'https': 'foo.bar:3128'}))

boto3 资源 https://boto3.readthedocs.io/en/latest/reference/core/session.html#boto3.session.Session.resource

botocore 配置 https://botocore.readthedocs.io/en/stable/reference/config.html#botocore.config.Config

关于proxy - 如何将 HTTP/HTTPS 代理与 boto3 一起使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33480108/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com