There is a website which uses socket.io as its 'API'. Essentially, anyone can download the source code of the website and modify it to make their own client with little difficulty. For example, I have such six clients that all run the same custom client side script. The script is hosted on my own domain, not the one with the socket.io API.
I want to be able to keep track of who is connected, and keep a total of certain data. For example if each individual client has 0.5 balance, I want them to be able to know that the total is 3 balance, because of the server.
The most obvious approach I can think of is to do AJAX couple with calls to MySQL to keep track of things, but that seems long-winded.
I could also do CURL but that would be technically challenging.
Is there a simple and straight forward way of simply totaling a balance from six different socket.io clients and sending the information back to them?