xmpp - Can't get user online on Openfire through WebSockets and strophe-openfire.js -
i trying 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) , openfire server.
use code snippet 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 user "authenticated" still offline. on chrome console see response openfire 101 switching protocols , appropriate headers nothing more.
so question can cause connection.send($pres())
doesn't work , how send presence openfire.
thanks in advance.
andrew
sorry can't answer, having exact same problem. openfire server establishes websocket connection, never returns response for:
<?xml version='1.0'?><stream:stream to='satellite-l675' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en' xmlns:xml="http://www.w3.org/xml/1998/namespace">
i using openfire 3.8.2 .0006 websocktet plugin. trying use candy chat client.
i did accident communicate openfire websocket bypassing authentication , sending this:
sent: <stream:stream to='satellite-l675' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'/>
sent: <presence xmlns='jabber:client'/>
sent: <iq type='get' from='@satellite-l675/candy' to='welcome@conference.satellite-l675' id='disco3' xmlns='jabber:client'> <query xmlns='http://jabber.org/protocol/disco#info'/> </iq>
sent: <presence from='satellite-l675/candy' to='welcome@conference.satellite-l675/yogi' xmlns='jabber:client'> <x xmlns='http://jabber.org/protocol/muc'/> </presence>
sent: <iq type='get' from='@satellite-l675/candy' id='get1' xmlns='jabber:client'> <query xmlns='jabber:iq:privacy'> <list name='ignore'/> </query> </iq>
recv: <body rid='3282533506' xmlns='http://jabber.org/protocol/httpbind'> <presence xmlns='jabber:client' from='welcome@conference.satellite-l675/yogi' to='msos_ws_candy@satellite-l675/msos_ws_candy'> <x xmlns='http://jabber.org/protocol/muc#user'> <item affiliation='none' role='participant'/> </x> </presence> </body>
so websocket works isn't easy understand why , how. , interesting thing is, sparkweb demo included openfire works fine, sends <iq>
's. doesn't seem bother <stream:...this...>
, <stream:...that...>
stuff.
so, given limited documentation, can conclude openfire websockets use <iq>
's , successful communication due the <iq>
sent requesting disco#info.
so how send request authentication? reference examples or documentation appreciated.
Comments
Post a Comment