Node.js solution for XMPP BOSH prebinding to return SID and RID

I need to authenticate Openfire XMPP sessions server-side, and pass the session to strophe.js. However, I cannot find a prebinding library that works.

I've been working with the maintainer of https://github.com/node-xmpp/node-xmpp-client, but we've not been able to resolve the following:

var XMPP = require('node-xmpp-client')


var prebind = new XMPP({
    jid: 'metalaureate@localhost',
    password: 'holonarchy',
    wait: 60,
    bosh: {
        url: 'http://localhost:7070/http-bind/',
        prebind: function(error, data) {
            if (error) throw new Error(error);
            console.log(data);
            return data
            /*
                data.sid
                data.rid
             */
        }
    }
})

prebind.on('online', function() { console.log('Connected') });

I used Wireshark to verify that the correct stanza are getting sent to my BOSH endpoint, and Openfire is returning with the correct response, but the module never returns the callback.

Sends:

Receives:

<body xmlns="http://jabber.org/protocol/httpbind" xmlns:stream="http://etherx.jabber.org/streams" from="localhost" authid="8bdd62a3" sid="8bdd62a3" secure="true" requests="2" inactivity="30" polling="5" wait="10" hold="1" ack="1836153693" maxpause="300" ver="1.6">

Any got any workarounds or know other node libraries that can do prebinding?

I hope this link will help you please refer : https://github.com/node-xmpp/node-xmpp-client/issues/77

 var XMPP = require('node-xmpp-client');
    var prebind = new XMPP({
        jid: 'test@localhost',
        password: 'xxx',
        preferred: 'PLAIN',
        wait: 10,
        bosh: {
            url: 'http://localhost:5280/http-bind/',
            prebind: function (error, data) {
                if (error) throw new Error(error);
                data.jid = 'test@localhost';
                console.log(data);
                **return res.send(data);**
            }
        },
        reconnect: true

    });