LP#1268619: OpenSRF JS websockets plugin

Adds an opensrf_ws.js handler.  Requries some small modifications to
opensrf.js.  Load opensrf_ws.js in DojoSRF.

For now, to use, add to script:

OpenSRF.Session.transport = OSRF_TRANSPORT_TYPE_WS;

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
LP#1268619: Apache websocket translator module

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
LP#1268619: websocket gateway repairs and cleanup

* use jsonObjectFree() on jsonObjets, not free();
* removed some debugging logs
* accommodate API changes for Apache 2.4
* safer logging:

  Avoid using ap_log_rerror, in particular referencing server->request
  from the responder thread, since the request_rec will be invalid after
  on_disconnect is called.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
LP#1268619: track websocket_plugin.h locally until replaced by makefile.install process

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
LP#1268619: websocket JS additions

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
LP#1268619: websocket translator

* starting packet inspection
* activity log; recipient removal
* only cache connected recipients; use request_rec pool for session_pool parent
* wrap all thread work in mutex
* session memory goodness

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
LP#1268619: websocket; docs, more memory mgmt

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
LP#1268619: websockets; free temporary osrf msgs; minor comment change

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
LP#1268619: websocket gateway: improved memory mgt; logging

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
LP#1268619: Sample Websocket translator Apache 2.2 configuration

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
LP#1268619: temporary websocket installer README

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
LP#1268619: websocket: do not disconnect ws() on osrf disconnect message

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
LP#1268619: websockets: support WS via shared web workers

This allows mutiple browser tabs to share the same websocket connection.

TODO: add tab (port) disconnect handler
TODO: more docs / examples

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
LP#1268619: websocket translator idle timeout / graceful shutdown

Added support for an idle timeout and idle check interval configuration
variables.  These allow each websocket apache process to kick off
clients that have been connected and are idle for too long, thus hogging
a process unnecessarily.

Added a SIGUSR1 signal handler which forces the idle timeout to be very
low and a short re-check period so that the client can be kicked as soon
as there are no open conversations.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
LP#1268619: websocket JS libs: reconnect and auto-connect

JS clients no longer need to explicitly call the shared WS setup
routine.  It happens under the covers now.

JS client detects disconnects and reconnects when the next message send
attempt occurs.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
LP#1268619: websockets : added config docs to install readme

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
LP#1268619: websocket : more JS api docs

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
LP#1268619: websocket : apache gateway minor fixes

Replace remaining remote_ip calls with a get_client_ip() function which
operates for apache2 and apache4.

Make log functions for applying a log trace value accept const char*'s

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
LP#1268619: websocket: avoid module auto configuration

We don't want osrf_websocket_translator to be directly loaded as a
module, since it is not an apache module, but a shared library loaded by
an apache module (mod_websockets).  This is especially true of the default
apache instance.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
LP#1268619: websocket : add JS lib to makefile

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>