Are you using the Processing Network library? If so, you could just run a Processing sketch with a Server instance–no translation needed. I’ve tinkered a bit with this setup on a Debian server and might be able to help.
How about testing a client/server setup to get started?
This example just streams random data from a server to all connected clients. It’s a remix of advice I found here. I used Google Compute Engine to spin up a server running Debian Bullseye.
Server setup
# Install required packages.
sudo apt update
sudo apt install wget xvfb libxrender1 libxtst6 libxi6 default-jdk
# Download and install Processing.
wget https://github.com/processing/processing4/releases/download/processing-1292-4.2/processing-4.2-linux-x64.tgz
tar xzf processing-4.2-linux-x64.tgz
cd processing-4.2
./install.sh
# Create the demo sketch.
cd ..
mkdir server_demo
# Add starter code to server_demo.pde.
vi server_demo/server_demo.pde
# Run server.
sudo xvfb-run ./processing-4.2/processing-java --sketch=server_demo --run
server_demo.pde
// Server in cloud.
import processing.net.*;
Server myServer;
void setup() {
myServer = new Server(this, 80, "0.0.0.0");
}
void draw() {
if (frameCount % 60 == 0) {
int x = int(random(50, 150));
int y = int(random(50, 150));
String dataOut = x + "," + y;
myServer.write(dataOut);
}
}
client_demo.pde
// Client on laptop.
import processing.net.*;
Client myClient;
int x, y;
void setup() {
size(200, 200);
// 12.345.678.90 is a placeholder for the server's IP address.
myClient = new Client(this, "12.345.678.90", 80);
}
void draw() {
background(0);
if (myClient.available() > 0) {
String dataIn = myClient.readString();
String[] position = dataIn.split(",");
x = int(position[0]);
y = int(position[1]);
}
fill(255, 0, 0);
circle(x, y, 50);
}