Skip to content

Commit

Permalink
web GET and POST functions can now access https urls.
Browse files Browse the repository at this point in the history
  • Loading branch information
virtuo committed Dec 13, 2010
1 parent d3c18ed commit ea054fa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/nodetk/web.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ var REQ = function(type, url, data, options, callback) {
*/
var purl = URL.parse(url);
var qs = purl.query || '';
var client = http.createClient(purl.port || 80, purl.hostname);
var secure = purl.protocol == 'https:';
var default_port = secure && 443 || 80;
var client = http.createClient(purl.port || default_port, purl.hostname, secure);
client.addListener('error', function(err) {
console.log('Error in nodetk web client.');
console.log(err.message);
Expand Down

0 comments on commit ea054fa

Please sign in to comment.