diff --git a/lib/node.io/request.js b/lib/node.io/request.js index 9a4069a..93acc4d 100755 --- a/lib/node.io/request.js +++ b/lib/node.io/request.js @@ -174,7 +174,9 @@ Job.prototype.doRequest = function (method, resource, body, headers, callback, p port = (url.protocol === 'http:') ? 80 : 443; } - var host = http.createClient(port, url.hostname), + var secure = (url.protocol == 'https:') ? true : false; + + var host = http.createClient(port, url.hostname, secure), req_url = url.pathname; if (typeof headers.host === 'undefined') { @@ -502,4 +504,4 @@ var HttpProxy = function (host) { * Export proxies */ exports.HttpProxy = HttpProxy; -exports.Proxy = Proxy; \ No newline at end of file +exports.Proxy = Proxy;