Step 1. I see there is a websockets library for Processing, with both server and client examples. You could start by switching from the networking library to the websockets library. Play a bit with it. So far it will be just local, in your computer.
Step 2. When you get that part, you can try switch to nodejs. If you’ve never done JavaScript, you will have to learn a bit. It’s not soo different from Processing/Java, but it is a different language. Try read watch/read simple tutorials for nodejs. Nodejs has a package manager called npm. It allows you to install packages, which is the equivalent to Processing libraries. You do that from the terminal with a simple command like
npm install somethingCool
That’s one reason nodejs is popular, because there are thousands of packages to do things. One of those packages is called socket.io which makes it easy to do websockets. This is a tutorial for creating a simple chat with socket.io: Get started | Socket.IO
So the idea is to replace the Processing websockets server (which runs only locally) with a nodejs websockets server, because that can be run on many servers online.
Ha! Looking for free nodejs servers you could use I found this list: https://www.hostingadvice.com/blog/where-to-find-free-node-js-hosting/#free and they list 3 options that can run Java. So that can be a different approach to try, together with Running without a Display · processing/processing Wiki · GitHub
Learning about nodejs and sockets can be valuable, but I don’t know how much time and effort you can afford in this project ![]()
One more resource, this time using p5.js: