Home > Uncategorized > Proxy testing script in #NodeJs

Proxy testing script in #NodeJs

img_56f57e1899a0f

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>

Advertisement
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: