Home
> Uncategorized > Proxy testing script in #NodeJs
Proxy testing script in #NodeJs
Not going to win any awards, but here is a little script in Node.js to test if a proxy is working or not
const request = require(‘request’);
request({
‘url’:’http://icanhazip.com’,
‘proxy’:process.argv[2]
}, function (error, response, body) {
console.log(‘error:’, error); // Print the error if one occurred
console.log(‘statusCode:’, response && response.statusCode); // Print the response status code if a response was received
console.log(‘ip:’, body); // Print the HTML for the Google homepage.
});
It requires npm install request
and is run like node proxycheck.js <ProxyAddress>
Categories: Uncategorized
Comments (0)
Trackbacks (0)
Leave a comment
Trackback