Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //hahahha
- process.setMaxListeners(0);
- process.on('uncaughtException', function(e){});
- // Agents
- var httpsagent = require('https-proxy-agent');
- //Request
- var request = require('request');
- var WebSocket = require('ws');
- //Load text files & colors
- var colors = require('colors');
- var fs = require('fs'); fs.open("proxyw.txt", 'a', 666, function(e, id) {global.id = id });
- var proxies = fs.readFileSync('proxy.txt').toString().split("\n");
- console.log("Loaded: " + proxies.length.toString().red.bold);
- proxies = proxies.filter(function(elem, pos) {
- return proxies.indexOf(elem) == pos;
- })
- console.log("Remove duplicates. Proxies now: " + proxies.length.toString().green.bold +"\n Starting...".green.bold);
- //=====================
- var i = 0;
- var pc = 0;
- //=====================
- //
- // Ex. node checker 50
- // ;p
- //=====================
- var proxy_ms = process.argv[2] ? process.argv[2] : 100;
- class Checker {
- constructor(data) {
- this.data = data;
- this.servers = [
- "ws://game08.na.alis.io:5022",
- "ws://game01.eu.alis.io:5016",
- "ws://game02.eu.alis.io:5010",
- "ws://game08.na.alis.io:5017",
- "ws://game01.eu.alis.io:5003",
- "ws://game01.eu.alis.io:5009",
- "ws://game01.eu.alis.io:5011",
- "ws://game01.eu.alis.io:5016",
- "ws://game02.eu.alis.io:5002",
- "ws://game02.eu.alis.io:5004",
- "ws://game02.eu.alis.io:5010",
- "ws://game02.eu.alis.io:5015",
- "ws://game02.eu.alis.io:5017",
- "ws://game03.eu.alis.io:5001",
- "ws://game03.eu.alis.io:5005",
- "ws://game03.eu.alis.io:5014",
- "ws://game03.eu.alis.io:5018",
- "ws://game04.eu.alis.io:5006",
- "ws://game04.eu.alis.io:5008",
- "ws://game04.eu.alis.io:5013",
- "ws://game05.eu.alis.io:5007",
- "ws://game05.eu.alis.io:5012",
- "ws://game05.eu.alis.io:5019",
- "ws://game05.eu.alis.io:5020"
- ];
- }
- test(ip) {
- var self = this;
- request({
- url: 'http://alis.io',
- agent: new httpsagent('http://' + ip),
- headers: {
- 'Accept-Language': 'pl-PL,pl;q=0.8,en-US;q=0.6,en;q=0.4',
- 'User-Agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.89 Safari/537.35',
- 'Accept-Encoding': 'gzip, deflate, sdch'
- }
- },
- function(error, response, body) {
- console.log("Working proxy: " + pc.toString().green + " Current: " + i + " / " + proxies.length);
- if (!error && response.headers["set-cookie"]) {
- self.test_ws(ip, response.headers["set-cookie"]);
- }
- });
- }
- test_ws(ip, cookie) {
- var ws = null;
- var ws = new WebSocket(this.servers[Math.floor(Math.random()*this.servers.length)], {
- agent: new httpsagent('http://' + ip),
- origin: 'http://alis.io',
- headers: {
- 'Origin' : 'http://alis.io',
- 'Accept-Language': 'pl-PL,pl;q=0.8,en-US;q=0.6,en;q=0.4',
- 'User-Agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.89 Safari/537.35',
- 'Accept-Encoding': 'gzip, deflate, sdch',
- 'Cookie' : cookie
- }
- });
- ws.onopen = function() {
- pc++;
- fs.write(global.id, ip + '\n', null, 'utf8', function() {
- console.log("Working proxy: " + pc + " Current: " + i + " / " + proxies.length);
- });
- ws.close()
- }
- ws.onclose = function(e){}
- ws.onerror = function(e){}
- setTimeout(()=>{
- ws.close();
- ws = null;
- }, proxy_ms + 10);
- }
- }
- var proxy = new Checker();
- function myLoop () {
- setTimeout(function () {
- i++;
- if (i < proxies.length) {
- proxy.test(proxies[i]);
- myLoop();
- }
- if(i === proxies.length || i === proxies.length-1){
- console.log("Done... Proxy checker by " + "l3mpik".red);
- process.exit();
- }
- }, proxy_ms);
- }
- myLoop();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement