作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
关于旧的boto
库很简单,可以使用 proxy
, proxy_port
, proxy_user
和proxy_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/
我是一名优秀的程序员,十分优秀!