Comments (2)
默认通过环境变量http_proxy 和 https_proxy实现代理,或者在代码里面设置http.Transport实现代理。
proxy := func(_ *http.Request) (*url.URL, error) {
return url.Parse("http://ip:port")
}
c := cos.NewClient(b, &http.Client{
Transport: &cos.AuthorizationTransport{
SecretID: os.Getenv("COS_SECRETID"),
SecretKey: os.Getenv("COS_SECRETKEY"),
Transport: &http.Transport{
Proxy: proxy,
DialContext: (&net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
DualStack: true,
}).DialContext,
MaxIdleConns: 100,
IdleConnTimeout: 90 * time.Second,
TLSHandshakeTimeout: 10 * time.Second,
ExpectContinueTimeout: 1 * time.Second,
},
},
})
from cos-go-sdk-v5.
谢啦
from cos-go-sdk-v5.
Related Issues (20)
- Support `POST` method for object presign HOT 1
- 为什么 v0.7.12 的 presignURL 会有 u0026 转义问题? HOT 2
- 上传为什么不支持 io.Reader, 常用的都是上传业务, 这样还得先存到临时目录再用 HOT 1
- Is wrong tag? HOT 1
- The path in the *url.URL returned by GetPresignedURL begins with 2 "/" when param name begin with "/" HOT 1
- Copy 接口返回「expected element type <CopyObjectResult> but have <Error>」 HOT 1
- 我能在 newclient 之后再设置 bucketurl么 看了下api 没找到合适的 或者说有没有灵活点的,不然每次不同的bucket都需要从新new一次 HOT 1
- 不支持form-data请求方式上传到cos
- rand.Seed 只需要在init中设置一次 HOT 1
- `tencentcloud/tencentcloud-sdk-go` 的版本冲突问题 HOT 3
- why not Add x-cos-tagging header when create bucket HOT 1
- 上传文件时如何添加自定义header? HOT 3
- 证书换了吗 HOT 2
- 没有CORS Vary: Origin相关的api HOT 1
- 如何使用内部ip
- 上传本地文件夹问题 HOT 2
- 高级分块上传支持自定义分块上传worker HOT 1
- Object.GetPresignedURL能否支持自定义authtime startTime HOT 1
- GetObjectURL无法获取到正确的链接。
- 您好,ACL用到的一些的字面值常量是否可以做成枚举值呢?或者加一些内置的常量这样外部调用时可以引用? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cos-go-sdk-v5.