I am trying to make real-time chat using HTML5, WebSockets, strophe-openfire.js library (https://code.google.com/p/openfire-websockets/source/browse/trunk/src/ofchat/js/strophejs/src/strophe-openfire.js) and Openfire server.
I use this code snippet to make connection:
function connectHandler(cond) {
log("connected");
connection.send($pres());
}
var url = "ws://localhost:7070/ws";
connectButton.onclick = function() {
var username = document.getElementById("username").value;
var password = document.getElementById("password").value;
var connection = new Openfire.Connection (url);
connection.connect(username, password, connectHandler);
}
I see on Openfire admin console in Client Sessions tab that user is "Authenticated" but is still Offline. On Chrome console I see response from Openfire with 101 Switching Protocols and appropriate headers but nothing more.
so my question is what can be the cause that connection.send($pres())
doesn't work and how to send presence to Openfire.
thanks in advance.
Andrew