Connect to

I was wondering if it is possible to connect a processing sketch using the websockets library to I tried it and got an error.

1 Like

Dan Shiffman did a video series on this. If that doesn’t help, could you describe what you’re trying to accomplish? Post your code and the error you’re getting.

1 Like

I’m trying to get a processing websocket server to read and print messages sent over the example server:

Here is my code:

import websockets.*;

WebsocketClient w;

void setup() {
 w = new WebsocketClient(this, "ws://localhost:3000");

void webSocketEvent(String msg) {

And here is my error:

[Animation Thread] INFO org.eclipse.jetty.util.log - Logging initialized @1855ms
[WebSocketClient@48536915-28] WARN - read - EOF Reached
onError(EOFException: Reading WebSocket Upgrade response) Reading WebSocket Upgrade response
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
	at org.eclipse.jetty.util.thread.QueuedThreadPool$

Were you able to resolve your problem?

I browsed previous websockets discussion on the old forum:

but wasn’t sure if they were relevant to your issue.

Forum members with websockets experience might be found in previous threads here:

1 Like

I haven’t been able to fix it yet, I have been working on other things. I wasn’t able to find anything easily on the old forum. I will have to dig deeper. Thanks!

Update: I tested with ws, and my everything worked fine. It must have something to do with

Another update: Changing the Url has made it possible to receive messages, although they are in weird formats. I changed the url to “ws://localhost:3000/”. Sending also doesn’t work.