I am writing a simple chat client (using strophe) which connects to my Openfire server. Strophe works successfully with BOSH, but for some reason cannot connect using websockets.
I have installed the latest version (websockets-0.0.0.6) of “WebSockets Plugin” plugin for OpenFire, using the default path “ws”. My client url is ws://my-server:7070/ws.
I get the following error in my browser console:
WebSocket connection to ‘ws://127.0.0.1:7070/ws/’ failed: Error during WebSocket handshake: Unexpected response code: 404
I have it working on my laptop with OpenFire v3.9.3 and the old websockets-0.0.0.6.zip file from https://code.google.com/p/openfire-websockets/downloads/list. I use my own version of strophe.js for websockets, which I am still working on. It seems to work pretty good, but it hasn’t been rigorously tested. Anyway, here is where you can find the code:
The rest of the strophe.js related files are there too. I am using Strophe.js with Candy Chat, and those files for reference are as follows:
Simple demo page and configuration: ttps://github.com/OpenSiteMobile/candyjs
Actual Candy Chat (my version): ttps://github.com/OpenSiteMobile/osm_candy
I spent a fair amount of time piecing together the best of what I could find at the time for websockets and OpenFire (about a year ago). If nothing else, it should be a good starting point or ref. for the next iteration, if there is going to be one.