// websockets
// https://github.com/alexandrainst/processing_websockets
// file websocket_client2.pde
// processing 3.5.3 on win7 / 64bit
import websockets.*;
String outmsg="Client mouse click";
String server = "ws://localhost:8025/socket";
// if i use my RPI as server: "ws://192.168.1.203:8025/socket"; //
WebsocketClient wsc;
void setup() {
size(500, 500);
wsc= new WebsocketClient(this, server);
println("pls wait for mouse click on server canvas");
}
void draw() {
}
void mouseClicked() {
wsc.sendMessage(outmsg);
}
void webSocketEvent(String msg) {
println("event: "+msg);
}
( means both sketch run on same computer )
then the console print works / but might be little bit confusing regarding
in what IDE window the print occurs.
Thank you for the reply. I found the solution. For some reason the program does not work if you copy/paste the example code from github. But, if I run it directly from the examples folder it works fine.