We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I'm trying to connect to the Blockchain websocket API (https://blockchain.info/api/api_websocket), since I have no idea where to start except for processing.net, I quickly modified the clientEvent() example to this:
import processing.net.*;
Client myClient;
void setup() {
size(200, 200);
myClient = new Client(this, "ws://ws.blockchain.info/inv", 8335);
}
void draw() { }
void clientEvent(Client someClient) {
println(myClient.read());
}
This throws an error, but I'm not sure why. Anyone knows what's wrong and (more importantly) how to connect to the Blockchain web socket API?
Thanks :-)
Answers
Apparently, you need a special WebSocket client, provided by Java libraries like this one: https://github.com/TooTallNate/Java-WebSocket