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?