Closed ghost closed 8 years ago
My agar is http://agareoz.com/ Then is...
// ----- Client authenticity check code -----
// !!!!! WARNING !!!!!
// THE BELOW SECTION OF CODE CHECKS TO ENSURE THAT CONNECTIONS ARE COMING
// FROM THE OFFICIAL AGAR.IO CLIENT. IF YOU REMOVE OR MODIFY THE BELOW
// SECTION OF CODE TO ALLOW CONNECTIONS FROM A CLIENT ON A DIFFERENT DOMAIN,
// YOU MAY BE COMMITTING COPYRIGHT INFRINGEMENT AND LEGAL ACTION MAY BE TAKEN
// AGAINST YOU. THIS SECTION OF CODE WAS ADDED ON JULY 9, 2015 AT THE REQUEST
// OF THE AGAR.IO DEVELOPERS.
var origin = ws.upgradeReq.headers.origin;
if (origin != 'http://es.agareoz.com' &&
origin != 'https://es.agareoz.com' &&
origin != 'http://localhost' &&
origin != 'https://localhost' &&
origin != 'http://THE-IP-OF-VPS?' &&
origin != 'https://THE-IP-OF-VPS?') {
ws.close();
return;
}
// -----/Client authenticity check code -----
Or as? xD
origin != 'http://THE-IP-OF-VPS?'
isn't needed. Yeah that looks just about right :)
// ----- Client authenticity check code -----
// !!!!! WARNING !!!!!
// THE BELOW SECTION OF CODE CHECKS TO ENSURE THAT CONNECTIONS ARE COMING
// FROM THE OFFICIAL AGAR.IO CLIENT. IF YOU REMOVE OR MODIFY THE BELOW
// SECTION OF CODE TO ALLOW CONNECTIONS FROM A CLIENT ON A DIFFERENT DOMAIN,
// YOU MAY BE COMMITTING COPYRIGHT INFRINGEMENT AND LEGAL ACTION MAY BE TAKEN
// AGAINST YOU. THIS SECTION OF CODE WAS ADDED ON JULY 9, 2015 AT THE REQUEST
// OF THE AGAR.IO DEVELOPERS.
var origin = ws.upgradeReq.headers.origin;
if (origin != 'http://es.agareoz.com' &&
origin != 'https://es.agareoz.com') {
ws.close();
return;
}
// -----/Client authenticity check code -----
Now this is good?
Looks alright.
Remember though, origin header is created and send by the web browser, and there a ton of ways to go around that. It is a poor way to protect your server. If you truly seek to make it unique, change the package numbers and or even include some secure layer protocol protection. Using browser headers, is never wise to use as identification for a game service. Flash, Java or other.
Hi programmers, i have a doubt. The question is this. For example, this is the ip and port of agarabi.com: 212.83.57.138:450 But if we do this: http://agar.io/?ip=212.83.57.138:450 or http://ogar.mivabe.nl/?ip=212.83.57.138:450
¡NO CONNECT! Neither in no other agar! I want to do something like that, how I do him?
Thanks.