Thursday, 13 April 2017

why after some time xmpp client offline in node js

I want to develop an instant messaging for web application, like facebook, with nodejs as my backend. I have gone through XMPP protocols and read xmpp.org documentation as well. why xmpp show status offline

      connection = new xmpp.Client({
        jid: send_id + '@testing.twodegrees.io',
        password: send_id,
    }, function (err) {
        if (err)
            throw (err);
        console.log('connection error', err);
    });
    connection.on('error', function (err) {

    });
    connection.on('offline', function () {
        console.log('Client is offline');
    });
    connection.on('online', function () {
        var presence = new xmpp.Element('presence', { type: 'available' }).c('show').t('chat');
connection.send(presence);

    });



via Tester Boy

No comments:

Post a Comment