!include once #1015699 // websocket sclass PrintingWebSocketClient extends WebSocketClient { *(URI uri) { super(uri); } *(URI uri, SS httpHeaders) { super(uri, httpHeaders); } public void onMessage(S s) { print("WebSocket received: " + s); } public void onOpen(ServerHandshake handshake) { print("WebSocket opened"); } public void onClose(int code, S reason, bool remote) { print("WebSocket closed, code " + code + ", reason: " + reason + ", remote: " + remote); } public void onError(Exception e) { printStackTrace(e); } }