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

Enable proxy for aws sdk #1954

Open
wants to merge 1 commit 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
10 changes: 8 additions & 2 deletions collectors/aws/collector.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,18 @@

var AWS = require('aws-sdk');
var async = require('async');
var https = require('https');
var helpers = require(__dirname + '/../../helpers/aws');
var collectors = require(__dirname + '/../../collectors/aws');
var collectData = require(__dirname + '/../../helpers/shared.js');
var proxy = require('proxy-agent');

// Configure proxy from environment variables if exists
// Envs: http_proxy, https_proxy, no_proxy
var agent = new proxy.ProxyAgent();

// Override max sockets
var agent = new https.Agent({maxSockets: 100});
agent.maxFreeSockets = 100

AWS.config.update({httpOptions: {agent: agent}});

var rateError = {message: 'rate', statusCode: 429};
Expand Down
9 changes: 7 additions & 2 deletions collectors/aws/collector_multipart.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,18 @@

var AWS = require('aws-sdk');
var async = require('async');
var https = require('https');
var helpers = require(__dirname + '/../../helpers/aws');
var collectors = require(__dirname + '/../../collectors/aws');
var collectData = require(__dirname + '/../../helpers/shared.js');
var proxy = require('proxy-agent');

// Configure proxy from environment variables if exists
// Envs: http_proxy, https_proxy, no_proxy
var agent = new proxy.ProxyAgent();

// Override max sockets
var agent = new https.Agent({maxSockets: 100});
agent.maxFreeSockets = 100

AWS.config.update({httpOptions: {agent: agent}});

var CALLS_CONFIG = {
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
"dependencies": {
"@alicloud/pop-core": "^1.7.10",
"@azure/data-tables": "^13.2.2",
"@azure/storage-blob": "^12.14.0",
"@azure/storage-file-share": "^12.14.0",
"@azure/storage-queue": "^12.13.0",
"@azure/storage-blob": "^12.14.0",
"@octokit/app": "^3.0.0",
"@octokit/request": "^3.0.3",
"@octokit/rest": "^16.3.2",
Expand All @@ -57,6 +57,7 @@
"google-auth-library": "^8.1.1",
"minimatch": "^3.0.4",
"ms-rest-azure": "^2.6.0",
"proxy-agent": "^6.4.0",
"tty-table": "^4.1.3"
},
"devDependencies": {
Expand All @@ -66,4 +67,4 @@
"nodemon": "^1.19.4",
"nyc": "^14.1.1"
}
}
}