There is a website that uses socket.io as an "API". In fact, anyone can download the source code of a website and modify it to make their own client with little difficulty. For example, I have six clients, all of which run the same client side of the script. The script is hosted on my own domain, not on it with socket.io API.
I want to be able to track who is connected and to store certain data in general. For example, if each individual client has 0.5 balance, I want them to know that the total amount is 3 balance due to the server.
The most obvious approach I can come up with is to make an AJAX pair with MySQL calls to keep track of things, but that seems long.
I could also do CURL, but that would be technically difficult.
Is there a simple and direct way to simply summarize the balance from six different socket.io clients and send the information back to them?
source share