Created
June 23, 2014 13:02
-
-
Save akshay-bhardwaj/bc130c682a49cac3f724 to your computer and use it in GitHub Desktop.
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 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