文档

代理配置

更新时间:

本节主要介绍原版 SDK 如何进行网络代理配置。

原版 SDK 可以通过环境变量:

• HTTP_PROXY 或者 http_proxy

• HTTPS_PROXY

• NO_PROXY

支持代理或者在初始化 Client 阶段设置请求的代理可以设置,优先级:Client > 环境变量:

AlibabaCloud::accessKeyClient('<access-key-id>', '<access-key-secret>')
              ->regionId('cn-hangzhou')
              ->asDefaultClient()->options([
                'proxy' => [
                    'http'  => 'http://localhost:8125', // Use this proxy with "http"
                    'https' => 'http://localhost:9124', // Use this proxy with "https",
                    'no' => ['example.com']    // Don't use a proxy with these
                ]
              ]);
  • 本页导读 (1)
文档反馈