Skip to content

Commit 8e27859

Browse files
committed
feat:初识化支持透传request tunnel参数
1 parent d677ce6 commit 8e27859

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ declare namespace COS {
154154
Protocol?: string,
155155
/** 设置代理,格式如 http://127.0.0.1:8888 */
156156
Proxy?: string,
157+
/** 透传给request */
158+
Tunnel?: boolean,
157159
/** 开启兼容模式,默认 false 不开启,兼容模式下不校验 Region 是否格式有误,在用于私有化 COS 时使用 */
158160
CompatibilityMode?: boolean,
159161
/** 强制使用后缀式模式发请求。后缀式模式中 Bucket 会放在域名后的 pathname 里,并且 Bucket 会加入签名 pathname 计算,默认 false */

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cos-nodejs-sdk-v5",
3-
"version": "2.11.10",
3+
"version": "2.11.11",
44
"description": "cos nodejs sdk v5",
55
"main": "index.js",
66
"types": "index.d.ts",

sdk/base.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3719,6 +3719,9 @@ function _submitRequest(params, callback) {
37193719
if (this.options.Proxy) {
37203720
opt.proxy = this.options.Proxy;
37213721
}
3722+
if (typeof this.options.Tunnel === 'boolean') {
3723+
opt.tunnel = this.options.Tunnel;
3724+
}
37223725
if (this.options.Timeout) {
37233726
opt.timeout = this.options.Timeout;
37243727
}

sdk/cos.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ var defaultOptions = {
3535
UploadQueueSize: 1000,
3636
UploadIdCacheLimit: 500,
3737
Proxy: '',
38+
Tunnel: undefined,
3839
Ip: '',
3940
StrictSsl: true,
4041
KeepAlive: true,

0 commit comments

Comments
 (0)