Tigase WebSockets

John Catron
Added over 5 years ago

Has anyone else tried this much yet?

Have Chrome and Safari logging in via WebSocket. Firefox refuses to work even with the same JS and same Tigase backend despite fact that Firefox certainly supports WebSockets as described by the HTML5 rfc.

Also seem to have the issue of disconnection with Safari and Chrome after 4-5 minutes or so. Connection just severs with seemingly no stimuli. Is there some sort of 'keep alive' I need to be sending?

I have tried newest version of both Firefox and Mac Firefox to see if those do anything different and alas both do not work.

Replies (4)


Added by Artur Hefczyc TigaseTeam over 5 years ago

Websockets is quite a new feature and may not always work as expected. We are still polishing it and working on it. Andrzej, the code author will give you more details on the possible configuration options.

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam over 5 years ago

What JS script were you using to connect to Tigase backend?

Which version of Tigase were you using?

While I was testing WebSocket implementation I have had some issues with Firefox mainly due to very strict parsing of XML implemented in Firefox and I was force to modify JS script responsible for parsing XML for Firefox to catch parsing exceptions and handle them properly, as Firefox parser was not able to process XML stream, but only properly formatted XML document.

Disconnetion after 4-5 minutes in Chrome and Safari was caused by Tigase not sending response for OPTIONS request used by this browsers to check cross origin policy headers. It should be already fixed in newest versions of Tigase.

Added by John Catron over 5 years ago

We are using JSJaC as the javascript to connect to Tigase.

Our Tigase version is 5.2.0-beta2.

We figured out the 4-5 minute issue was actually a problem with our proxy having a timeout so that was our bad.

As far as Firefox we have still been unable to get it to actually establish a connection.

Have you made any progress on Firefox to be released in -beta3 or 5.2.0 Stable or could you possibly enlighten us on what you did with your JS client to make Firefox able to connect?

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam over 5 years ago

I do not think there are any changes waiting to be released as beta3 related to problems with connecting from Firefox using WebSocket and JSJaC but I will try to check this issue soon. Our JS clients were written using GWT in Java and compiled to JS so I cannot give you changes you need to make in JS.

I looked into data parsing method created in JSJaC for WebSocket and it does not contain fixes needed for Firefox to work. If this method (parseXML) will receive on begin of stream, then on Chrome it will parse it and silently ignore unclosed XML tag, but on Firefox will throw exception here. In our clients tags known to be received as unclosed tags by browser are automaticaly closed before processing to fix this issue on Firefox. For example of a fix see our XMPP client library project class - method parseSocketData in file