Hey @fresla are you trying to do “push” notifications to the browser from an OF server?
You should be able to access the websocket route (a member of the ofxJSONRPCServer) via
Since the example client js library is intended to parse requests rather than pushed data, you will have to take a look and see how to handle websocket frames that it didn’t request.
If you don’t want to broadcast to all connected clients, you can keep track of new ofxHTTP::WebSocketConnection by subscribing to the WebSocketRoute events and sending messages directly using the connection’s ofxHTTP::WebSocketConnection::sendFrame(…) method. The classes are all documented pretty extensively inline, but I don’t have an example of that right now (though it is all implemented under a few layers in ofxJSONRPC server).
Alternatively, you might also take a look at the server sent events route in ofxHTTP would work for you. But if you are already using websockets, you don’t really need to do that.