Well, i mainly use Processing, i learned it coming from Arduino.
Recently i started also with JS, and i know there is node.js, but since Processing have the network library i was wondering if what i asked was possible, with it.
I understand what you mean, and I'm sure there would be so many ways to do it better with a more specific instruments, but this is true about many thing that usually are also done with Processing, in a kind of sketch scale.
The short answer is that no, there isn't a server-side version of Processing.
You can use Processing from a server-side application, in the same way that you can use Processing from a Java application in eclipse. But if you're looking for something that just works when you press play, you're out of luck.
"You can use Processing from a server-side application"
Actually, even that is hard, because most web servers are headless, ie. doesn't have a display, while Processing needs a display to start...
No, but for "server" i would just mean like a laptop running as server for the period of an event (maybe a week), serving html pages with js and reciving the output of some js function.
KevinWorkman, from the feedback of those having tried, even Processing as a library needs a display. The workaround they used is to simulate such display with xvfb.
secondsky, there are lot of small free web server software available, it is simpler and more efficient to choose one for what you describe. A nice one is Mongoose, for example.
I just successfully deployed a webapp to AWS and used the Processing library to create a PImage on the server side, which passed info about that PImage to the client side.
Well, since Processing's framework isn't active, we have to make our own draw() mechanism.
Most basic is a simple delay() at the end of the infinite loop! :P
Answers
Why do you want to use Processing as a web server? That's really not what Processing is used for...
It might be possible to call certain Processing functions from a Java web server, but why would you want to?
Because i'm only able to use processing... :-)
What do you mean "only able"? Do you mean you only know how to use Processing? Or is there some other kind of restriction?
This really doesn't seem like a job for Processing. Programming languages are like tools. Use the write tool for the job.
Well, i mainly use Processing, i learned it coming from Arduino. Recently i started also with JS, and i know there is node.js, but since Processing have the network library i was wondering if what i asked was possible, with it. I understand what you mean, and I'm sure there would be so many ways to do it better with a more specific instruments, but this is true about many thing that usually are also done with Processing, in a kind of sketch scale.
The short answer is that no, there isn't a server-side version of Processing.
You can use Processing from a server-side application, in the same way that you can use Processing from a Java application in eclipse. But if you're looking for something that just works when you press play, you're out of luck.
Got it! :-)
"You can use Processing from a server-side application"
Actually, even that is hard, because most web servers are headless, ie. doesn't have a display, while Processing needs a display to start...
No, but for "server" i would just mean like a laptop running as server for the period of an event (maybe a week), serving html pages with js and reciving the output of some js function.
I just meant you could use it as a Java library. Presumably to use the PGraphics class or something like that.
I think OP is barking up the wrong tree, but it's at least possible to use it that way.
KevinWorkman, from the feedback of those having tried, even Processing as a library needs a display. The workaround they used is to simulate such display with xvfb.
secondsky, there are lot of small free web server software available, it is simpler and more efficient to choose one for what you describe. A nice one is Mongoose, for example.
I'm not saying you're wrong, but yikes, that doesn't make any sense. Why would I need a display just to create an instance of PGraphics?
Anyway I've never tried it so I don't know what I'm talking about, but the point stands: what the OP is looking for isn't really a Processing thing.
"Why would I need a display just to create an instance of PGraphics?"
Because Processing has been designed for visual feedback, not as a library.
I just successfully deployed a webapp to AWS and used the Processing library to create a PImage on the server side, which passed info about that PImage to the client side.
So, it's at least possible.
Cool! but, can you explain me what you did so? To have a kind of draw() function, could il launch a thread in the setup like:
Well, since Processing's framework isn't active, we have to make our own draw() mechanism.
Most basic is a simple delay() at the end of the infinite loop! :P
But what is the delay() for in this case?
Dunno. Try
delay(10)
or something! Or check how Processing calculates how much it gotta delay().