Skip to content

Instantly share code, notes, and snippets.

@akshay-bhardwaj
Created June 23, 2014 13:02
Show Gist options
  • Save akshay-bhardwaj/bc130c682a49cac3f724 to your computer and use it in GitHub Desktop.
Save akshay-bhardwaj/bc130c682a49cac3f724 to your computer and use it in GitHub Desktop.
var http = require('http');
var globalTunnel = require('global-tunnel');
globalTunnel.initialize({
host: 'localhost', // set proxy ip or hostname
port: 9091, // set proxy port
sockets: 50 // optional pool size for each http and https
});
http.get("http://www.browserstack.com", function(resp){
var data = "";
resp.on('data', function(temp){
data += temp;
});
resp.on('end', function(){
console.log(data);
});
});
process.on('exit', function(code){
console.log("Going to quit the script: " + code.toString());
globalTunnel.end();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment