Sending immediate updates from the client via a websocket

I am using javascript atmosphere client to get updates from the server and it’s working well. This is how the request and subscription looks like:

var headers = {};
headers["Accept"] = "application/json";

var request = {
    url: 'http://linx:8080/rest/items/lamp1',
    contentType : "application/json",
    transport: 'websocket',
    headers: headers,
    attachHeadersAsQueryString: true

request.onMessage = function (response) {
    var message = response.responseBody;
    try {
        var json = jQuery.parseJSON(message);
    } catch (e) {
        console.log('This doesn\'t look like a valid JSON: ', message);

var subSocket = socket.subscribe(request);

Now I would like to use the same websocket to send values from the client to the server. I have a slider on a page to control a light dimmer and by moving the slider I would like to send immediate updates to the server which in turn would publish those values via MQTT to the light dimmer.
I looked at GreenT and even though it it using atmosphere for server-push updates, it sends values from the client via xhr requests which I don’t think are optimal for fast changing values.

I have tried


12 being the value I want to set for the dimmer and also

subSocket.push(jQuery.stringifyJSON({ state: '12' }));

but all I got in OpenHAB console was:

[WARN ] [.w.protocol.SimpleHttpProtocol] - Status code higher or equal than 400. Unable to deliver the websocket messages to installed component. Status 404 Message Not Found

So is there a way to make this work? Can I send the values from the client to the server via a websocket?