0

Ok so people keep botting my multi-ogar edited server(which is like an agar.io private server), and I noticed that they all use the same user-agent. How can I use ws to detect how many connections are coming from the same user agent so I can block them?

Something like

if (useragentconnections += 3) {
    ws.terminate()
}
Coll y
  • 83
  • 1
  • 3
  • 11

1 Answers1

0

Unless you require some sort of account login/authentication, there is no foolproof mechanism to identify the same user-agent. Here are some techniques that can be used, each with varying degrees of success:

  1. Cookie the connection with some sort of unique ID. All webSocket connections start with an http request so you can cookie them. If this is from a browser, the cookie will be presented at each new webSocket connection from that user agent and you can identify them. If this is a programmatic webSocket coming from some custom code, then they may not retain the cookie so this would not work.

  2. Look at the IP address and count connections from that IP address. If the user is an individual home user, then this will uniquely identify any users connecting from that home network. If this is a corporate user, then there may be many users on that corporate network that appear to be coming from the same IP address via NAT so you may falsely identify lots of users within the same corporate/business network as having the same IP address.

  3. Require some sort of account login/authentication and have some terms of service. If you identify misuse either automatically or manually, you can then ban that account.

  4. Require some manual "human" intervention in order to get logged onto your server such as a captcha. This is to prevent automatic programmatic logins and require that a human be on the other end.

jfriend00
  • 683,504
  • 96
  • 985
  • 979
  • We use glitch, so all ip addresses are 127.0.0.1 adresses. – Coll y Sep 03 '19 at 01:10
  • @Colly - I don't know what glitch is (a link would be handy), but you will need some way for the original IP address to be forwarded to your server or your options are more limited. – jfriend00 Sep 03 '19 at 01:18
  • @Colly - I've given you the typical tools one uses to solve this problem which is what your question asked. If you want ask a specific question about the glitch programming environment, then I'd suggest you start a new question and make it all about what you can do inside of glitch. – jfriend00 Sep 03 '19 at 03:06