tunneling secure websocket connections with apache

I’ve got it working. Scenario ————- —————- ———- | Browser |<—–>| Apache httpd |<—–>| Tomcat | | | SSL | 2.4.9 | SSL | 7.0.52 | ————- —————- ———- Browser WebSocket through Apache httpd, reverse proxying to the web app in Tomcat. All SSL front-to-back. Here’s the configuration for each piece: Browser Client Note the … Read more

How to run glassfish 4 on port 80 instead of 8080? root access is not an issue

To run GlassFish on port 80 you need to : Connect to the administration interface (by default on port :4848) In the left menu go to Configurations Then select the appropriate configuration you need to change eg server-config Then go to Network Config Then go to Network Listeners Select the appropriate listener, probably http-listener-1 Change … Read more

WebSocket: How to automatically reconnect after it dies

Here is what I ended up with. It works for my purposes. function connect() { var ws = new WebSocket(‘ws://localhost:8080’); ws.onopen = function() { // subscribe to some channels ws.send(JSON.stringify({ //…. some message the I must send when I connect …. })); }; ws.onmessage = function(e) { console.log(‘Message:’, e.data); }; ws.onclose = function(e) { console.log(‘Socket … Read more

Reconnection of Client when server reboots in WebSocket

When the server reboots, the Web Socket connection is closed, so the JavaScript onclose event is triggered. Here’s an example that tries to reconnect every five seconds. function start(websocketServerLocation){ ws = new WebSocket(websocketServerLocation); ws.onmessage = function(evt) { alert(‘message received’); }; ws.onclose = function(){ // Try to reconnect in 5 seconds setTimeout(function(){start(websocketServerLocation)}, 5000); }; }

What specific use cases call for BOSH over WebSockets and long-polling? [closed]

First let me address WebSockets readiness: WebSockets implementation of the Hixie-76 protocol are shipped and enabled by default in Chrome, Safari and iOS (iPhone and iPad). The Hixie-76 protocol is also shipped but disabled by default in Firefox 4 and Opera 11. The web-socket-js project is a Flash shim/polyfill that adds WebSocket (Hixie-76) support to … Read more