Permalink
Browse files

Merge pull request #5 from developmentseed/agent

Make HTTP agent configurable
  • Loading branch information...
2 parents d67090c + 2463329 commit 98f48e069e26abc46132ef0a6ac8967bd7859e7a @willwhite willwhite committed Sep 19, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/node-get/node-get.js
View
@@ -65,6 +65,7 @@ function Get(options) {
} else {
this.proxy = {};
}
+ this.agent = options.agent || undefined;
}
}
@@ -89,6 +90,7 @@ Get.prototype.request = function(callback) {
// TODO: should pronode-getxies support HTTPS?
if (this.uri_o.protocol == 'https:') {
return https.request({
+ agent: this.agent,
host: this.uri_o.hostname,
port: 443,
headers: this.headers,
@@ -100,6 +102,7 @@ Get.prototype.request = function(callback) {
}, callback);
} else {
return http.request({
+ agent: this.agent,
port: this.proxy.port || this.uri_o.port || 80,
host: this.proxy.hostname || this.uri_o.hostname,
headers: this.headers,

0 comments on commit 98f48e0

Please sign in to comment.