1
votes

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://localhost:7070/ws' failed: Error during WebSocket handshake: Unexpected response code: 302

I look at other related post (stackoverflow.com/questions/22983302/strophe-failed-to-connect-openfire-by-websocket) but have not been successful.

Has anyone come across this problem before?

Any help would really be appreciated.

Thanks in advance.

1
What do you see when going to http://my-server:7070/ws from browser address bar?Uluk Biy
... and http://my-server:7070/Uluk Biy
For my-server:7070/ws I see in the browser: Openfire HTTP Binding Servicesilvade
For my-server:7070/ws I see the directory structure in the browser the following: Directory: /ws/ WEB-INF/ changelog.html lib/ ofchat-010.crx peek/ plugin.xml readme.html sparkweb/ web/silvade

1 Answers

0
votes

I'm assuming you were using the latest version of Strophe. The openfire-websocket is developed against with older version Strophe 1.0 . They are not capable now. You can take a look at https://community.igniterealtime.org/thread/53783