0

I have configured openfire with xampp and checked the default 7443 and 5222 ports for http-bind and c2s connections respectively. I have registered users adam,levine on openfire. Now I am trying to open control box for the registered users but I am facing issues. html file to run converse

<!DOCTYPE html>
<html lang="en">
    <head>
    <title>Converse</title>
    <link type="text/css" rel="stylesheet" media="screen" href="https://cdn.conversejs.org/5.0.4/dist/converse.min.css" />
    <script src="https://cdn.conversejs.org/5.0.4/dist/converse.min.js"></script>
</head>

    <script>
         converse.plugins.add('myplugin', {
      initialize: function() {
        var _converse = this._converse;
        Promise.all([
            _converse.api.waitUntil('rosterContactsFetched'),
            _converse.api.waitUntil('chatBoxesFetched')
        ]).then(function() {
          _converse.api.chats.open('adam@localhost.resource');
        });
      }
    });

    converse.initialize({
      bosh_service_url: 'https://localhost:7443/http-bind/',
      show_controlbox_by_default: true,
      whitelisted_plugins: ['myplugin'],
      debug: true
    });
    </script>
</html>

Now on running this nothing is happening (control box is also not opening )and I am getting this error

converse-core.js:284  2019-11-27T19:12:11.257Z WARNING: Disconnect was called because: undefined 
converse-core.js:284  2019-11-27T19:12:11.257Z WARNING: Disconnect was called before Strophe connected to the server 
converse-chatboxviews.js:103 Uncaught (in promise) DOMException: Failed to execute 'appendChild' on 'Node': Only one element on document allowed.
    at i._ensureElement (https://cdn.conversejs.org/5.0.4/dist/converse.min.js:152:10339)
    at i.t.View (https://cdn.conversejs.org/5.0.4/dist/converse.min.js:55:44153)
    at i.constructor (https://cdn.conversejs.org/5.0.4/dist/converse.min.js:55:100544)
    at i.Backbone.Overview (https://cdn.conversejs.org/5.0.4/dist/converse.min.js:152:526)
    at new i (https://cdn.conversejs.org/5.0.4/dist/converse.min.js:55:53600)
    at Object.<anonymous> (https://cdn.conversejs.org/5.0.4/dist/converse.min.js:152:11125)
    at g (https://cdn.conversejs.org/5.0.4/dist/converse.min.js:55:33025)
    at p (https://cdn.conversejs.org/5.0.4/dist/converse.min.js:55:32873)
    at l (https://cdn.conversejs.org/5.0.4/dist/converse.min.js:55:30789)
    at Object.a.trigger (https://cdn.conversejs.org/5.0.4/dist/converse.min.js:55:32766)
converse-minimize.js:575 Uncaught TypeError: Cannot read property 'trimChats' of undefined
    at converse-minimize.js:575
    at g (lodash.js:10377)
    at _ (lodash.js:10426)
    at v (lodash.js:10337)

Can someone help me how to resolve this ?

2 Answers2

0

Openfire has a plugin called inVerse. This plugin is a simple wrapper around Converse, that gives you a fully functional web client. I advice that you use this plugin, of only as an example for proper configuration.

Guus
  • 2,986
  • 2
  • 21
  • 32
0

Configuring Openfire with "localhost" as the xmpp domain name leads to network issues. Try using the server name instead.