From dd08421c9949c2f69143324aeb2c44a6ce78a168 Mon Sep 17 00:00:00 2001 From: maplehong Date: Thu, 10 Jan 2019 10:53:58 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=94=AF=E6=8C=81proxy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index 99950cd..9c2d202 100644 --- a/index.js +++ b/index.js @@ -19,6 +19,7 @@ var baseHost = 'api.qcloud.com' * @param {String} defaults.SecretId secretId * @param {String} defaults.SecretKey secretKey * @param {String} defaults.signatureMethod 签名方法,默认sha1 + * @param {String} defaults.proxy 代理地址 * @constructor */ var QcloudApi = function(defaults) { @@ -171,6 +172,7 @@ QcloudApi.prototype.request = function(data, opts, callback, extra) { assign(option, extra) + option.proxy = this.defaults.proxy request(option, function(error, response, body) { /** * `.request` 的请求回调 From 98ea3afc68d816277c50e9b2518d1fbeaa91c015 Mon Sep 17 00:00:00 2001 From: maplehong Date: Thu, 10 Jan 2019 10:55:42 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=96=87=E6=A1=A3=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 41322de..696fe16 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,8 @@ var Capi = require("qcloudapi-sdk"); var capi = new Capi({ SecretId: "Your SecretId here", SecretKey: "Your SecretKey here", - serviceType: "account" + serviceType: "account", + // proxy: 'proxy address' }); capi.request(