I wonder if anyone ever got Strophe.js to work with the WebSocket plugin on OpenFire? I tried to connect to my OpenFire server using Strophe.js with below code. I am using the last version of Strophe.js (version 1.1.3), and latest version of the plugin (version 0.0.0.6). I tried to debug Strophe. When it opens, it sent a message “<stream:stream to=‘chat-uat.seyzme.net’ xmlns=‘jabber:client’ xmlns:stream=‘http://etherx.jabber.org/streams’ version=‘1.0’>” to Openfire. However, on the Openfire side, it is complaining “org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 125; XML document structures must start and end within the same entity.”.
strophe-openfire.js is a strophe implementation of an xmpp client for openfire websockets. You can find it in the candy web client or ofmeet. I use Openfire.Connection as a direct replacement of Strophe.Connection
Note that since this thread was answered, the websocket plugin was improved. It now adheres to the standard specification. In other words, you can make Strophe (or any other websocket-implementation for that matter) connect to Openfire via websockets just fine.
Still produces: WebSocket connection to ‘wss://XXXX:7443/ofmeetws/server?username=XXX&password=null&resource=ofmeet4’ failed: Error during WebSocket handshake: Unexpected response code: 503
Michael, you’re trying to connect to the websocket implementation that is in OFMeet. I’d suggest you use the plugin cleverly named “Openfire Websocket” instead. Then, the path that you use should be equal to that of HTTP-BIND ( :7443/http-bind/ by default). There’s an effort underway to remove the OFMeet-specific websocket implementation from the OFMeet plugin, and use the Websockets plugin instead - so sooner or later, you probably need to switch anyway.