diff --git a/docs/config/01-configuration-file.md b/docs/config/01-configuration-file.md index ea58e3c0e..6198f6ea5 100644 --- a/docs/config/01-configuration-file.md +++ b/docs/config/01-configuration-file.md @@ -275,6 +275,12 @@ will return exit-code `0` and display a warning. See [config/files] for more information. +## forceJSONP +**Type:** Boolean + +**Default:** `false` + +**Description:** Force socket.io to use JSONP polling instead of XHR polling. ## frameworks **Type:** Array diff --git a/lib/config.js b/lib/config.js index 40621b402..7c90eb459 100644 --- a/lib/config.js +++ b/lib/config.js @@ -253,6 +253,7 @@ var Config = function () { this.reportSlowerThan = 0 this.loggers = [constant.CONSOLE_APPENDER] this.transports = ['polling', 'websocket'] + this.forceJSONP = false this.plugins = ['karma-*'] this.defaultClient = this.client = { args: [], diff --git a/lib/server.js b/lib/server.js index 4c8084419..a8fa70ce4 100644 --- a/lib/server.js +++ b/lib/server.js @@ -30,7 +30,8 @@ function createSocketIoServer (webServer, executor, config) { // avoid destroying http upgrades from socket.io to get proxied websockets working destroyUpgrade: false, path: config.urlRoot + 'socket.io/', - transports: config.transports + transports: config.transports, + forceJSONP: config.forceJSONP }) // hack to overcome circular dependency