Created
August 25, 2011 20:25
-
-
Save calderas/1171805 to your computer and use it in GitHub Desktop.
Node JS Twitter Stream behind a proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
quick test of the twitter stream api behind a firewall