Client transports within config.js
authorDarren <darren@darrenwhitlen.com>
Tue, 6 May 2014 23:34:26 +0000 (00:34 +0100)
committerDarren <darren@darrenwhitlen.com>
Tue, 6 May 2014 23:34:26 +0000 (00:34 +0100)
client/src/models/gateway.js
config.example.js
server/settingsgenerator.js

index 1e8c8bfb377d44393aaf223ceab6044873aa60cc..8113554551ab40c87dda61cc84f09e7abe10f5f6 100644 (file)
@@ -112,6 +112,7 @@ _kiwi.model.Gateway = function () {
         this.set('kiwi_server', _kiwi.app.kiwi_server);\r
 \r
         this.socket = new EngineioTools.ReconnectingSocket(this.get('kiwi_server'), {\r
+            transports: _kiwi.app.server_settings.transports || ['websocket', 'polling'],\r
             path: _kiwi.app.get('base_path') + '/transport',\r
             reconnect_max_attempts: 5,\r
             reconnect_delay: 2000\r
index 1314152faca35ffd7e098867d91271a7372bcfea..b11a0f90903c8ec088983813d35035a0b248e937 100644 (file)
@@ -55,6 +55,10 @@ conf.identd = {
 // Where the client files are
 conf.public_http = "client/";
 
+// Transports available to the client.
+// Behind an Apache reverse proxy? Uncomment the below - Apache does not support websockets!
+//conf.client_transports = ['polling'];
+
 // Max connections per connection. 0 to disable
 conf.max_client_conns = 5;
 
index 0a3463f9ce96f389cf439381690d19e89feec7ac..e6a3c4af328064599024d9bd0a225ec634958596 100644 (file)
@@ -80,6 +80,11 @@ function generateSettings(debug, callback) {
         vars.server_settings.client = config.get().client;
     }
 
+    // Client transport specified?
+    if (config.get().client_transports) {
+        vars.server_settings.transports = config.get().client_transports;
+    }
+
     // Any client plugins?
     if (config.get().client_plugins && config.get().client_plugins.length > 0) {
         vars.client_plugins = config.get().client_plugins;