diff --git a/lib/restler.js b/lib/restler.js index 895b005..23698ef 100644 --- a/lib/restler.js +++ b/lib/restler.js @@ -71,6 +71,7 @@ function Request(uri, options) { } var proto = (this.url.protocol == 'https:') ? https : http; + var agent = (this.options.agent) ? this.options.agent : undefined; this.request = proto.request({ host: this.url.hostname, @@ -78,7 +79,8 @@ function Request(uri, options) { path: this._fullPath(), method: this.options.method, headers: this.headers, - rejectUnauthorized: this.options.rejectUnauthorized + rejectUnauthorized: this.options.rejectUnauthorized, + agent: agent }); this._makeRequest();