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 :

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://"));

callbacks to send, receive and to close connection

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

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

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

    public void sendMessage(String str) throws IOException {

Thanks for any help in advance!

I would suggest, if there is , to use client for JavaFX…
Maybe this?

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

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

[code] public void socketIoConnect() throws URISyntaxException {
socket = IO.socket(“”);
socket.on(Socket.EVENT_CONNECT, new Emitter.Listener() {

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

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

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

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

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

    }).on(Socket.EVENT_MESSAGE, objects -> consumer.accept(objects.toString()));

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