Commit 8cc191ea by Vitalik Ovcharenko

Add support proxy

parent 2ddd53de
...@@ -12,14 +12,16 @@ var slice = Array.prototype.slice; ...@@ -12,14 +12,16 @@ var slice = Array.prototype.slice;
* @param {String} api The API key for the Full Contact service. * @param {String} api The API key for the Full Contact service.
* @api public * @api public
*/ */
function FullContact(api) { function FullContact(api, proxy) {
if (!(this instanceof FullContact)) { if (!(this instanceof FullContact)) {
return new FullContact(api); return new FullContact(api, proxy);
} }
this.key = api; // API key this.key = api; // API key
this.version = 'v2'; // API version this.version = 'v2'; // API version
this.proxy = proxy || null;
this.remaining = 0; // How many API calls are remaining this.remaining = 0; // How many API calls are remaining
this.ratelimit = 0; // The amount of API calls allowed this.ratelimit = 0; // The amount of API calls allowed
this.ratereset = 0; // In how many seconds is the rate limit reset this.ratereset = 0; // In how many seconds is the rate limit reset
...@@ -211,7 +213,8 @@ FullContact.prototype.exec = function exec(fn) { ...@@ -211,7 +213,8 @@ FullContact.prototype.exec = function exec(fn) {
requests: requests.map(function urlsonly(data) { requests: requests.map(function urlsonly(data) {
return data.url; return data.url;
}) })
} },
proxy: this.proxy
}, function requested(err, res, body) { }, function requested(err, res, body) {
if (err) { if (err) {
return bailout(err); return bailout(err);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment