JavaFx plus socket api

Dear volumio community,
I’m haveng a hard time trying to develop java FX application which can control volumio player via it’s socket api.
Can anyone suggest which socket client is preferable to use in Java?
For now I’m trying to connect to volumio with jetty web socket client javax.websocket.WebSocketContainer.
Connection starts normaly, I’m getting connection messgae from volumio :
0{“sid”:“4zDRZQNFnEdCzHhbAABE”,“upgrades”:[],“pingInterval”:25000,“pingTimeout”:60000}40

But when I try to send any message, my connection closes right after message is sent with status message: CloseReason[1000].
Thus I have no answer back. Did anybody try to use java fx for player control?
Please take a look at my code below:
Code to connect to player

WebSocketContainer container = ContainerProvider.getWebSocketContainer(); container.connectToServer(clientSocket, new URI("ws://192.168.1.201:3000/socket.io/?EIO=3&transport=websocket"));

callbacks to send, receive and to close connection

    @OnOpen
    public void onOpen(Session session) {
        System.out.println("Connected to server");
        this.session = session;
    }

    @OnMessage
    public void onText(String message, Session session) {
        consumer.accept(message);
        System.out.println("Message received from server:" + message);
    }

    @OnClose
    public void onClose(CloseReason reason, Session session) {
        System.out.println("Closing a WebSocket due to " + reason.getReasonPhrase());
    }

    public void sendMessage(String str) throws IOException {
        session.getBasicRemote().sendText(str);
    }

Thanks for any help in advance!

I would suggest, if there is , to use socket.io client for JavaFX…
Maybe this?
github.com/socketio/socket.io-client-java

Hi Michelangelo, thanks for the link, will this approach soon. Strange I couldn’t find socket.io for java myself (

HI to all!
Just tried to use proposed socket.io client. No results, it doensn’t even get connected.
Hire is my connection code:

[code] public void socketIoConnect() throws URISyntaxException {
socket = IO.socket(“http://192.168.1.201/ioSocket.io/?EIO=3&transport=websocket”);
socket.on(Socket.EVENT_CONNECT, new Emitter.Listener() {

        @Override
        public void call(Object... args) {
            socket.emit("foo", "hi");
            socket.disconnect();
        }

    }).on("event", new Emitter.Listener() {

        @Override
        public void call(Object... args) {}

    }).on(Socket.EVENT_DISCONNECT, new Emitter.Listener() {

        @Override
        public void call(Object... args) {}

    }).on(Socket.EVENT_MESSAGE, objects -> consumer.accept(objects.toString()));
    socket.connect();
}[/code]

Any suggestions? Does anyone know, how to change protocol to ws, as simply substitute http to ws leads to an exception?