How do you use an HTTP/HTTPS proxy with boto3?

后端 未结 4 2066
北海茫月
北海茫月 2021-01-01 11:58

On the old boto library is was simple enough to use the proxy, proxy_port, proxy_user and proxy_pass paramet

4条回答
  •  难免孤独
    2021-01-01 12:36

    If you user proxy server does not have a password try the following:

    import os
    os.environ["HTTP_PROXY"] = "http://proxy.com:port"
    os.environ["HTTPS_PROXY"] = "https://proxy.com:port"
    

    if you user proxy server has a password try the following:

    import os
    os.environ["HTTP_PROXY"] = "http://user:password@proxy.com:port"
    os.environ["HTTPS_PROXY"] = "https://user:password@proxy.com:port"
    

提交回复
热议问题