Simplist way to have a high score server across multiple locations?

I feel I am pretty competent with Processing (java) but have no experience with servers and the like. What would be the best/easiest way to implement a “server/broker” that could allow multiple instances of a sketch simultaneously running in various locations around the country to have a synchronized high score list?

I know there are lots of way to accomplish this but the only one that I can think of would be to use the network library, link the client machines through a VPN like ZeroTierOne, and run a separate server sketch that can parse and compare the incoming scores. I have not tested it but it sounds doable. Thinking 100 clients max.
Thanks!

I’m writing a drawing application in Processing and connect instances to a central server running a PHP/SQLite database using the contributed library, HTTP Requests for Processing. It’s pretty simple to send POST or GET (html form or query string style) data from Processing. PHP is what I chose but it could be Python, Perl, or even Java. Most web hosting platforms can handle a multitude of languages.

1 Like

one solution: Network / Libraries / Processing.org

or my favorite
node.js with express.js and socket.io

Full example: GitHub - iaido42/nodeTest_p5Js: simple client/server with for p5js with node.js, express.js and socket.io

Socken.io is a library and protocol based an WebSocket (only for the first connect) but is faster
simple Server example server.js :
var express = require(“express”);
// express app instance
var app = express();
// server
var server = app.listen(3000);
// static files
app.use(express.static(“public”));
// socket.io instance
var socket = require(“socket.io”);
var io = socket(server);
// new connection event
io.sockets.on(“connection”, newConnection);
function newConnection(socket) {
console.log(“new connection” + socket.id);
console.log(socket.id);
// mouse event listener
socket.on(“mouse”, mouseMsg);
function mouseMsg(data) {
// broadcast to all clients
socket.broadcast.emit(“mouse”, data);
console.log(data);
}
}

Install and first steps Socket.IO with Node.Js + Express:
Socket.IO with Node.Js + Express. Nowadays, most web developers want to… | by Sude Kılıç | Koçfinans Tech | Medium

Client Socket.io Software for Java
GitHub - socketio/socket.io-client-java: Full-featured Socket.IO Client Library for Java, which is compatible with Socket.IO v1.0 and later.

very useful (p5js):

12.3: Connecting Client to Server with Socket.io - WebSockets and p5.js Tutorial