Skip to content

Instantly share code, notes, and snippets.

@novemberborn
Created February 4, 2010 23:04
Show Gist options
  • Save novemberborn/295246 to your computer and use it in GitHub Desktop.
Save novemberborn/295246 to your computer and use it in GitHub Desktop.
client = require("http").createClient(443, "twitter.com");
client.setSecure("X509_PEM");
client.request("GET", "/statuses/public_timeline.xml", { host: "twitter.com" }).finish(function(response){
var chunks = [];
response.setBodyEncoding("utf8");
response.addListener("body", function(c){ chunks.push(c); });
response.addListener("complete", function(){
require("sys").puts(chunks.join(""));
});
});
/* Error:
TypeError: Property 'tcpSetSecure' of object #<a Client> is not a function
at ClientRequest.<anonymous> (/usr/local/lib/node/libraries/http.js:429:18)
at ClientRequest.flush (/usr/local/lib/node/libraries/http.js:226:8)
at ClientRequest.<anonymous> (/usr/local/lib/node/libraries/http.js:232:8)
at ClientRequest.finish (/usr/local/lib/node/libraries/http.js:272:36)
at Object.<anonymous> (/Users/mark/Work/twitter-proxy/https.js:4:81)
at [object Object].<anonymous> (node.js:933:23)
at [object Object].emitSuccess (node.js:244:15)
at [object Object].<anonymous> (node.js:658:21)
at [object Object].emitSuccess (node.js:244:15)
at node.js:514:29
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment