From bbd5eb8688b2bc1e3dd04910aa68fd19c5036b31 Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Fri, 14 Jun 2013 23:09:51 -0700 Subject: [PATCH] feat(config): make socket.io transports configurable --- docs/config/01-configuration-file.md | 8 ++++++++ lib/config.js | 1 + lib/server.js | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/config/01-configuration-file.md b/docs/config/01-configuration-file.md index 12ad16e21..ca24a1cdf 100644 --- a/docs/config/01-configuration-file.md +++ b/docs/config/01-configuration-file.md @@ -227,6 +227,14 @@ If `true`, it captures browsers, runs tests and exits with `0` exit code (if all `1` exit code (if any test failed). +## transports +**Type:** Array + +**Default:** `['websocket', 'flashsocket', 'xhr-polling', 'jsonp-polling']` + +**Description:** An array of allowed transport methods between the server and the client. This is configuration of [socket.io](https://github.com/LearnBoost/Socket.IO/wiki/Configuring-Socket.IO). + + ## urlRoot **Type:** String diff --git a/lib/config.js b/lib/config.js index 377acf7f1..d0c0f5fce 100644 --- a/lib/config.js +++ b/lib/config.js @@ -258,6 +258,7 @@ var parseConfig = function(configFilePath, cliOptions) { dir: 'coverage/' }, loggers: [ constant.CONSOLE_APPENDER ], + transports: [ 'websocket', 'flashsocket', 'xhr-polling', 'jsonp-polling' ], plugins: [ 'karma-*' ] }; var dsl = new KarmaDsl(config); diff --git a/lib/server.js b/lib/server.js index 6470971fd..6373f0a3a 100644 --- a/lib/server.js +++ b/lib/server.js @@ -40,7 +40,7 @@ var start = function(injector, config, launcher, globalEmitter, preprocess, file var socketServer = io.listen(webServer, { logger: logger.create('socket.io', constant.LOG_ERROR), resource: config.urlRoot + 'socket.io', - transports: ['websocket', 'flashsocket', 'xhr-polling', 'jsonp-polling'] + transports: config.transports }); webServer.updateFilesPromise(filesPromise);