Skip to content

Instantly share code, notes, and snippets.

@calderas
Created August 25, 2011 20:25
Show Gist options
  • Save calderas/1171805 to your computer and use it in GitHub Desktop.
Save calderas/1171805 to your computer and use it in GitHub Desktop.
Node JS Twitter Stream behind a proxy
var user="your_user"
var password="your_password"
var proxy_host="your_proxy.com"
var proxy_port=80
var http = require('http'), sys = require('sys')
var proxy = http.createClient(proxy_port, proxy_host);
var request = proxy.request('GET', '/1/statuses/sample.json', { host: 'stream.twitter.com', Authorization:new Buffer(user+":"+password).toString('base64')});
request.addListener('response', function(response) {
response.addListener('data', function(chunk) { sys.puts(chunk) });
response.addListener('end', function() { sys.puts("end") });
});
request.end();
@calderas
Copy link
Author

quick test of the twitter stream api behind a firewall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment