Hosting A Processing.net server

I have a program that uses processing.net to send and receive data. I was wondering if there is a website where i could host this server for free. For the sake of example, I will use Shiffman’s basic chat server.
Server: http://learningprocessing.com/examples/chp19/example-19-01-simple-server
Client: http://learningprocessing.com/examples/chp19/example-19-02-simple-client

BUMP
Meeting Character Minimum

Hi! Your question totally confused me, specially because of the first link you have there, which is a domain totally unrelated to the Processing project (I even thought this was spam) :slight_smile:

What you want is actually to have a Processing program using the networking library running somewhere on a server, so you can connect to it from client Processing programs.

Finding a server where you can host Java programs for free is not trivial. Most servers run PHP, some servers run Nodejs, Ruby or Python. For small scale testing you might find a free Amazon AWS server that runs Java (not sure if that exists). But even if you found one, the program may need adjustments to run without a screen attached to the server.

I think a better approach would be to write a nodejs websockets server, and connect to it from Processing using a websockets library. That probably needs some learning and experimentation…

Maybe someone else can suggest a different approach?

2 Likes

Do you know how i would even begin to learn that?

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: https://socket.io/get-started/chat/

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 https://github.com/processing/processing/wiki/Running-without-a-Display

Learning about nodejs and sockets can be valuable, but I don’t know how much time and effort you can afford in this project :slight_smile:

One more resource, this time using p5.js:

1 Like