Comment 6 for bug 1268619

Revision history for this message
Bill Erickson (berick) wrote :

* overhauled the apache config to use a single, stripped-down apache2.conf instead of wrestling with disabling mods, ports.conf, etc. Just copy the file into place and restart.

* Apache setup docs are considerably simpler now. It's practically scriptable at this point.

* removed (at least for now) the trailing-behind single-tab websocket JS client implementation. maintaining 2 different implementations will complicate things and we probably don't want multi-tab clients to have the ability to (trivially) open numerous WS connections, anyway. Single connection (via SharedWorkers) across all tabs is the future.

Regarding SharedWorkers and Firefox. Current stable FF (version 28) requires SharedWorkers to be turned on in about: config (search for "shared"). It will be officially supported (and on by default) in FF version 29.

I believe we're ready for some brave soul to test it out. Here's a simple HTML test.

-------------
<html>
  <head>
    <script src='/js/dojo/opensrf/JSON_v1.js'></script>
    <script src='/js/dojo/opensrf/opensrf.js'></script>
    <script>
      OpenSRF.Session.transport = OSRF_TRANSPORT_TYPE_WS_SHARED;
        var ses = new OpenSRF.ClientSession('open-ils.actor'); // Evergreen
        ses.request({
          method : 'opensrf.system.echo',
          params : ['hello', 'websockets'],
          onresponse : function(r) {
            alert('onresponse() => "' + r.recv().content() + '"');
          },
          oncomplete : function() {
            alert('oncomplete()');
          }
      }).send();
    </script>
  <head>
  <body><h1>If you get alerts, you win!</h1></body>
<html>
----------------

The only thing special about this test is the OSRF_TRANSPORT_TYPE_WS_SHARED bit (and that it's all async).

Note that we don't have to load the websocket JS, because it's loaded as a shared worker from within opensrf.js when activated.