Comments (11)
That can be for different reasons.
You say you use proxy, do you use some custom lib/agent? Lib socks
in example can use only SOCKS4/SOCKS5 servers. It does not working with proxy.
Is that the case?
If not, then you need some sniffer to debug whats happening. I can recommend Microsoft Network Monitor
or wireshark
to see what is going there.
from agario-client.
Check packets from/to SOCKS server with Microsoft Network Monitor
or wireshark
.
Or show packets here so i can see what is wrong.
from agario-client.
Here you go
from agario-client.
It says "This file is not available, because the upload was interrupted.".
*If you want to upload .pcap file, be sure that you closed all applications that can send your passwords or some important data before capturing.
Also if it is .pcap file, tell me IP of your SOCKS server that was used while capturing packets.
from agario-client.
Okay let me try again, http://ge.tt/1Cwgi8U2/v/0 and the proxy ips are 121.40.34.139:3128 and 31.184.242.173:3130
from agario-client.
I do not see there SOCKS IP at all. Are you sure your code is correct?
Show your createAgent()
function or test it replacing with this:
function createAgent() {
return new Socks.Agent({
proxy: {
ipaddress: '121.40.34.139',
port: 3128,
type: 5
}}
);
}
Replace SOCKS IP with working one, if this SOCKS is dead already.
from agario-client.
I do see communications with 104.20.38.148:80
(http://m.agar.io/) and 151.80.98.51:1511
(ws://151.80.98.51:1511) without any SOCKS.
There is something wrong with code i think.
Can you show me your code?
from agario-client.
var stock = ["121.40.34.139:3128", "31.184.242.173:3130"];
var http=require('http');
var Socks = require('socks');
var AgarioClient = require('./agario-client/agario-client.js');
var botnames = ["DrGoat"];
//pick a random array
function randomarray(array) {
return array[Math.floor(Math.random() * array.length)];
}
//Basic info for bot
function ExampleBot(bot_id) {
this.bot_id = bot_id; //ID of bot for logging
this.nickname = randomarray(botnames);//default nickname
this.verbose = true; //default logging enabled
this.interval_id = 0; //here we will store setInterval's ID
this.server = ''; //server address will be stored here
this.server_key = ''; //server key will be stored here
this.client = new AgarioClient('Bot ' + this.bot_id); //create new client
this.client.debug = 1; //lets set debug to 1
this.agent = ''
}
//Uses stock5 proxy
function createAgent() {
var dataaa = randomarray(stock).split(":")
return new Socks.Agent({
proxy: {
ipaddress: (dataaa[0]),
port: (dataaa[1]),
type: ('5')
}}
);
}
var agent = createAgent();
//Options for getFFAServer
var get_server_opt = {
region: 'EU-London', //server region
agent: agent //our agent
};
//Bot AI
ExampleBot.prototype = {
log: function(text) {
if(this.verbose) {
console.log(this.bot_id + ' says: ' + text);
}
},
connect: function(server, key) {
this.log('Connecting to ' + server + ' with key ' + key);
this.server = server;
this.server_key = key;
this.client.connect(server, key);
this.attachEvents();
},
attachEvents: function() {
var bot = this;
bot.client.on('connected', function() {
bot.log('Connected, spawning');
bot.client.spawn(bot.nickname);
bot.interval_id = setInterval(function(){bot.recalculateTarget()}, 100);
});
bot.client.on('connectionError', function(e) {
bot.log('Connection failed with reason: ' + e);
bot.log('Server address set to: ' + bot.server + ' key ' + bot.server_key);
});
bot.client.once('leaderBoardUpdate', function(old, leaders) {
var name_array = leaders.map(function(ball_id) {
return bot.client.balls[ball_id].name || 'unnamed'
});
bot.log('Joined server');
});
bot.client.on('lostMyBalls', function() {
bot.client.spawn(bot.nickname);
});
bot.client.on('reset', function() { //when client clears everything (connection lost?)
clearInterval(bot.interval_id);
});
},
recalculateTarget: function() {
var bot = this;
bot.client.moveTo(0, 0);
}
};
//launching bots below
//object of bots
var bots = {
'Alpha' : null,
'Bravo' : null,
'Charlie': null,
'Delta' : null,
'1' : null,
'2' : null,
'3': null,
'4' : null,
'5' : null
};
//searching party for bots in EU-London
function start() {
console.log('Requesting party server');
AgarioClient.servers.createParty({region: 'EU-London'}, function(srv) {
if(!srv.server) return console.log('Failed to request server (error=' + srv.error + ', error_source=' + srv.error_source + ')');
console.log('Engaging bots to party http://agar.io/#' + srv.key + ' on IP ' + srv.server);
for(var bot_id in bots) {
bots[bot_id] = new ExampleBot(bot_id);
bots[bot_id].agent = createAgent();
console.log('using agent ' + bots[bot_id].agent)
bots[bot_id].connect('ws://' + srv.server, srv.key);
}
});
}
startServer()
from agario-client.
I see there few problems.
- For every new connection you use
createAgent()
which usesrandomarray()
which returns random SOCKS server.
So you can request server/key from one IP but connect from another and server will disconnect you immediately for that. You need to request server/key and connect from same IP, through same SOCKS. - For requesting server/key you do have options
var get_server_opt
but you do not use them at all. - Line 121 have
AgarioClient.servers.createParty({region: 'EU-London'}, function(srv) {
you did not specifiedagent
in options here. Server/Key will be requested directly from your IP. startServer()
is not defined, it should bestart()
i think.- While fixing, i have crash
Error: Please specify a proxy type in options.proxy.type
which because oftype: ('5')
it should beinteger
type -type: 5
So after "fixes" here is "working" code
var stock = ["1.2.3.4:5678"];
var http=require('http');
var Socks = require('socks');
var AgarioClient = require('./agario-client/agario-client.js');
var botnames = ["DrGoat"];
//pick a random array
function randomarray(array) {
return array[Math.floor(Math.random() * array.length)];
}
//Basic info for bot
function ExampleBot(bot_id) {
this.bot_id = bot_id; //ID of bot for logging
this.nickname = randomarray(botnames);//default nickname
this.verbose = true; //default logging enabled
this.interval_id = 0; //here we will store setInterval's ID
this.server = ''; //server address will be stored here
this.server_key = ''; //server key will be stored here
this.client = new AgarioClient('Bot ' + this.bot_id); //create new client
this.client.debug = 1; //lets set debug to 1
this.agent = ''
}
//Uses stock5 proxy
function createAgent() {
var dataaa = randomarray(stock).split(":");
return new Socks.Agent({
proxy: {
ipaddress: (dataaa[0]),
port: (dataaa[1]),
type: 5
}}
);
}
var agent = createAgent();
//Options for getFFAServer
var get_server_opt = {
region: 'EU-London', //server region
agent: agent //our agent
};
//Bot AI
ExampleBot.prototype = {
log: function(text) {
if(this.verbose) {
console.log(this.bot_id + ' says: ' + text);
}
},
connect: function(server, key) {
this.log('Connecting to ' + server + ' with key ' + key);
this.server = server;
this.server_key = key;
this.client.connect(server, key);
this.attachEvents();
},
attachEvents: function() {
var bot = this;
bot.client.on('connected', function() {
bot.log('Connected, spawning');
bot.client.spawn(bot.nickname);
bot.interval_id = setInterval(function(){bot.recalculateTarget()}, 100);
});
bot.client.on('connectionError', function(e) {
bot.log('Connection failed with reason: ' + e);
bot.log('Server address set to: ' + bot.server + ' key ' + bot.server_key);
});
bot.client.once('leaderBoardUpdate', function(old, leaders) {
var name_array = leaders.map(function(ball_id) {
return bot.client.balls[ball_id].name || 'unnamed'
});
bot.log('Joined server');
bot.log('Leaders on server:' + name_array);
});
bot.client.on('lostMyBalls', function() {
bot.client.spawn(bot.nickname);
});
bot.client.on('reset', function() { //when client clears everything (connection lost?)
clearInterval(bot.interval_id);
});
},
recalculateTarget: function() {
var bot = this;
bot.client.moveTo(0, 0);
}
};
//launching bots below
//object of bots
var bots = {
'Alpha' : null
};
//searching party for bots in EU-London
function start() {
console.log('Requesting party server');
AgarioClient.servers.createParty({region: 'EU-London', agent: createAgent()}, function(srv) {
if(!srv.server) return console.log('Failed to request server (error=' + srv.error + ', error_source=' + srv.error_source + ')');
console.log('Engaging bots to party http://agar.io/#' + srv.key + ' on IP ' + srv.server);
for(var bot_id in bots) {
bots[bot_id] = new ExampleBot(bot_id);
bots[bot_id].agent = createAgent();
console.log('using agent ' + bots[bot_id].agent)
bots[bot_id].connect('ws://' + srv.server, srv.key);
}
});
}
start();
If you add more than one SOCKS, it will stop work. You need use same SOCKS for requesting server/key and connection. You need to fix that.
Also setup somewhere your own SOCKS server for testing because public SOCKS usually are very very unstable.
I used ssspl for that. Please be careful to not allow somebody from internet use your SOCKS
from agario-client.
Thanks for the help! How would I get different ips to join the same party?
from agario-client.
How would I get different ips to join the same party?
What i can think of is modifying createAgent()
like
function createAgent(socks) {
return new Socks.Agent({
proxy: socks
}
);
}
Then rewrite start
to something like
function start() {
console.log('Requesting party server');
var socks = getNewSocksServer();
AgarioClient.servers.createParty({region: 'EU-London', agent: createAgent(socks)}, function(srv) {
if(!srv.server) return console.log('Failed to request server (error=' + srv.error + ', error_source=' + srv.error_source + ')');
console.log('Engaging bots to party http://agar.io/#' + srv.key + ' on IP ' + srv.server);
for(var bot_id in bots) {
bots[bot_id] = new ExampleBot(bot_id);
bots[bot_id].agent = createAgent(socks);
console.log('using agent ' + bots[bot_id].agent)
bots[bot_id].connect('ws://' + srv.server, srv.key);
}
});
}
And making getNewSocksServer()
is up to you. It should return object like
{
ipaddress: '1.2.3.4',
port: 567,
type: 5
}
Didn't tested, but i think you got the idea. You can even write socks
to bots[bot_id].socks
for future use if you will need it.
Oh, it may not work as it should. But you still got the idea.
from agario-client.
Related Issues (20)
- Where is the packet of the little pellets? HOT 3
- Facebook Tokens are not working no matter how. HOT 10
- Agario updated, bots no longer working. HOT 4
- Agario patched anyfix :( HOT 4
- agario-client fixed HOT 2
- THE END HOT 19
- Hey Pro pulviscriptor HOT 5
- HOW TO MAKE MY BOTS WORK HOT 6
- ITS NOT PATCHED! - Working FB, spawning, updating position, etc! HOT 27
- bots are back livestream proof HOT 2
- need help spawn packets instant disconnect HOT 3
- Bots are officially back!!!
- FAILED TO GET TOKEN help pls :) HOT 1
- deleted HOT 2
- I need help HOT 10
- cellcraft old agar.io HOT 1
- PROTOCOL 13 FINDED HOT 6
- Please give me any actual contact of Jaguar500070
- Run node ./node_modules/agario-client/examples/basic.js
- WRONG_HTTP_CODE error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from agario-client.