Skip to content

Commit

Permalink
v1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Frontesque committed Jan 22, 2022
1 parent 3fd5919 commit 56c1690
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 17 deletions.
File renamed without changes.
35 changes: 21 additions & 14 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const request = require('request');
const fs = require('fs');
require('colors');

console.log("Starting SPS v1.2 by Front#2990".bold.blue);
console.log("Starting 'Simple Proxy Checker' v1.3 by Front#2990".bold.blue);

//--- Functions ---//
function hang() { //Holds Output
Expand All @@ -22,24 +22,31 @@ const proxies = proxyFile.split('\r\n')
if (fs.existsSync('workingProxies.txt')) fs.renameSync('workingProxies.txt','workingProxies.txt.old');


//--- Make Request ---//
function testProxy(ip, callback) {
request({
'url':'https://api.ipify.org?format=json',
'method': "GET",
'proxy': 'http://'+ip,
}, callback);
}


//--- Make Requests Per Proxy ---//
for (const i in proxies) {
const proxy = proxies[i];
const startTime = Date.now();

request({
'url':'https://api.ipify.org?format=json',
'method': "GET",
'proxy': 'http://'+proxy,
}, function (error, response, body) {
const responseTime = Date.now() - startTime;
if (!error && response.statusCode == 200) {
console.log('Proxy Success:'.bold.green,proxy,`(${responseTime}ms)`.magenta);
fs.appendFileSync('workingProxies.txt', `${proxy}\r\n`)
} else {
console.log('Proxy Fail:'.bold.red,proxy,`(${responseTime}ms)`.magenta);
}
})
if (proxy == "") { return; }; // Fix empty lines from executing as a proxy

testProxy(proxy, (error, response, body) => {
const responseTime = Date.now() - startTime;
if (!error && response.statusCode == 200) {
console.log('Proxy Success:'.bold.green,proxy,`(${responseTime}ms)`.magenta);
fs.appendFileSync('workingProxies.txt', `${proxy}\r\n`)
} else {
console.log('Proxy Fail:'.bold.red,proxy,`(${responseTime}ms)`.magenta);
}
})

}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tiktok-view-bot",
"version": "1.2.0",
"description": "simple view bot for tiktok",
"name": "simple-proxy-checker",
"version": "1.3.0",
"description": "check to make sure that your proxies are working",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down

0 comments on commit 56c1690

Please sign in to comment.