1

According to Guidelines of https://github.com/strophe/strophejs-plugin-stream-management, I have included the statement to enable stream management as follows:

var url = BOSH_SERVICE;
connection = new Strophe.Connection(url);

connection.rawInput = rawInput;
connection.rawOutput = rawOutput;

var button = $('#connect').get(0);
if (button.value == 'connect' && $('#jid').val() != '' && $('#pass').val() != '') {
    connection.streamManagement.enable();
    connection.streamManagement.sendCountOnEveryIncomingStanza = true;
  var jid_val = $('#jid').val().toLowerCase().replace(/ /g, '');

  connection.connect(jid_val + '@' + server + `/${navigator.userAgent.split(' ')[2].split(';')[0]}`, $('#pass').get(0).value, onConnect);

}
}

The server should return 'enabled' or 'failed' but this is what I'm getting is this: https://i.stack.imgur.com/ttiRM.png

Any suggestions?

Saumay Paul
  • 405
  • 1
  • 7
  • 21
  • 2 questions: 1) is stream management enabled at XMPP server side? 2) I suggest to use WebSockets as a transport, not BOSH. Since BOSH is a HTTP protocol, I do not see any sense to use Stream management for it – Rubycon Jan 11 '19 at 10:45
  • But my server-Openfire 4.2.3 doesn't support Websockets plugin. Only HTTP binding is allowed. – Saumay Paul Jan 14 '19 at 09:46
  • then I think you do not need a Stream Management for HTTP since it's a reliable protocol by itself – Rubycon Jan 14 '19 at 19:27
  • Openfire also supports Websockets. Maybe you need to update your server to use Websockets and Stream Management. As mentioned here already in the comments BOSH has something similar already implemented. Its called inactivity and can be configured on the server. The server keeps the session alive until the inactivity period expires. – Alex Jan 20 '19 at 13:33

0 Answers0