Firefox 11 websockets and FOP2

[h]Firefox 11 websockets and FOP2 [/h]

Firefox 11 was released a couple of weeks ago. Now it includes html5 websockets support by default (previous versions had this feature disabled).

Unfortunately, the websocket handshake that Firefox 11 uses has a little piece of information that prevents the FOP2 websocket connection from succeeding.

This means that if you use Firefox 11, as is, it won't be able to connect with FOP2 versions 2.25 or prior.

I had to quickly update the FOP2 server to accept this handshake and make Firefox 11 websocket feature functional. This was implemented in FOP2 version 2.26.

So, if you upgrade FOP2 to version 2.26, you won' t have issues with Firefox 11, but with one exception: websocket connections are not going to be established by Firefox 11 if the http connection is done using ssl (https).


[h]Firefox 11 and FOP2 over HTTPS[/h]

There is a setting you can set in Firefox to allow websocket connections over https links, you have to type in the address bar:


[fixed]about:config [/fixed]

After accepting the warning window, search for:

[fixed]network.websocket.allowInsecureFromHTTPS [/fixed]

And set it to true

That will make websockets in Firefox 11 work even if the http connection is done via ssl. (You do not need to do this if you access the fop2 application using regular http connectios).

[h]Other ways around the issue[/h]

The problem is in the websocket handshake, it is possible to make it work by disabling websockets, either in FOP2 or in Firefox itself.

In FOP2, since version 2.24, you can disable websockets globally, you can edit the file /var/www/html/fop2/js/presence.js and in there set:

[fixed]var disableWebSocket = true;[/fixed]

Then be sure to clear your firefox cache and you will not have issues with websockets again, as FOP2 will use the Flash xmlsockets connection instead.

Alternatively, you can disable websockets support in Firefox, in the address bar go to:

[fixed]about:config[/fixed]

Accept the warning and search for:

[fixed]network.websocket.enabled[/fixed]

And set it to false.

Comments

  • I fop2 to version 30.2.06 and 48.0.2 firefox, and disconnect occurs with other fop2 users to make my connection.
    There are some configuration to enable WebSocket connections over HTTPS links?
  • Websocket is enabled by default in FOP2, so you do not have to do anything to have it.

    If you use https, then you must be sure to configure related ssl_ entries in fop2.cfg matching whatever certificate and key files you have configure din your web server, for example:

    ssl_certificate_file=/etc/pki/tls/certs/localhost.crt
    ssl_certificate_key_file=/etc/pki/tls/private/localhost.key

    As for firefox, it might reject self signed certificates for secure websocket by default, problem is that it does it silently, with no option for you to accept the self signed certificate, you can overcome that by pointing firefox just once to https://your.server:4445, then it will let you accept the self signed certificate. After that try to log to FOP2 normally.

    Best regards,
Sign In or Register to comment.