4-Proxy-zh.md
May 27, 2026 · View on GitHub
← Transport | 代理配置(English) | 超时配置 →
HTTP(S) 代理配置
默认
- 无代理
配置 HTTP(S) 代理
var ak, sk, region string
config = volcengine.NewConfig().
WithCredentials(credentials.NewStaticCredentials(ak, sk, "")).
WithRegion(region).WithHTTPProxy("http://your_proxy:8080").WithHTTPSProxy("http://your_proxy:8080")
sess, _ = session.NewSession(config)
client = ecs.New(sess)
注意事项
支持通过以下环境变量配置代理:
http_proxy/HTTP_PROXYhttps_proxy/HTTPS_PROXY
优先级:代码指定 > 环境变量。
← Transport | 代理配置(English) | 超时配置 →