I am trying to create a stanza connection with XMPP using javascript with my ejabberd server, I can establish a connection when the page loads and may disconnect when I click the disconnect button.
now the problem is that the connection is live, and if the user accidentally refreshes the page, then my javascript tries to connect again, and in response to this I get. (its only because the previous connection may still be alive)
<body xmlns='http://jabber.org/protocol/httpbind'> <failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> <not-authorized/> </failure> </body>
and after a while, if I refresh the page again, the connection will be successfully established, since I can reset the connection if the page is accidentally updated, so that the user gets a seamless connection.
source share