Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

增加proxy支持 #12

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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` 的请求回调
Expand Down