From: Darren Date: Tue, 6 May 2014 23:34:26 +0000 (+0100) Subject: Client transports within config.js X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9af18c41fef733089b9c7b576e50f1c9ee9517ae;p=KiwiIRC.git Client transports within config.js --- diff --git a/client/src/models/gateway.js b/client/src/models/gateway.js index 1e8c8bf..8113554 100644 --- a/client/src/models/gateway.js +++ b/client/src/models/gateway.js @@ -112,6 +112,7 @@ _kiwi.model.Gateway = function () { this.set('kiwi_server', _kiwi.app.kiwi_server); this.socket = new EngineioTools.ReconnectingSocket(this.get('kiwi_server'), { + transports: _kiwi.app.server_settings.transports || ['websocket', 'polling'], path: _kiwi.app.get('base_path') + '/transport', reconnect_max_attempts: 5, reconnect_delay: 2000 diff --git a/config.example.js b/config.example.js index 1314152..b11a0f9 100644 --- a/config.example.js +++ b/config.example.js @@ -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; diff --git a/server/settingsgenerator.js b/server/settingsgenerator.js index 0a3463f..e6a3c4a 100644 --- a/server/settingsgenerator.js +++ b/server/settingsgenerator.js @@ -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;