diff --git a/.gitignore b/.gitignore index b93678674..a3dd9f3b9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ node_modules settings.json +!settings.json.template APIKEY.txt bin/abiword.exe bin/node.exe diff --git a/settings.json.template b/settings.json.template index f6f3e5b85..e37bc4509 100644 --- a/settings.json.template +++ b/settings.json.template @@ -91,5 +91,8 @@ */ /* The log level we are using, can be: DEBUG, INFO, WARN, ERROR */ - "loglevel": "INFO" + "loglevel": "INFO", + + // restrict socket.io transport methods + "socketTransportProtocols" : ['xhr-polling', 'jsonp-polling', 'htmlfile'] } diff --git a/src/node/hooks/express/socketio.js b/src/node/hooks/express/socketio.js index c2b9ff6c7..524bab3d9 100644 --- a/src/node/hooks/express/socketio.js +++ b/src/node/hooks/express/socketio.js @@ -36,10 +36,10 @@ exports.expressCreateServer = function (hook_name, args, cb) { }); }); - // there shouldn#t be a browser that isn't compatible to all + // there shouldn't be a browser that isn't compatible to all // transports in this list at once // e.g. XHR is disabled in IE by default, so in IE it should use jsonp-polling - io.set('transports', ['xhr-polling', 'jsonp-polling', 'htmlfile']); + io.set('transports', settings.socketTransportProtocols ); var socketIOLogger = log4js.getLogger("socket.io"); io.set('logger', { diff --git a/src/node/utils/Settings.js b/src/node/utils/Settings.js index fb2a592cb..bed5a9a07 100644 --- a/src/node/utils/Settings.js +++ b/src/node/utils/Settings.js @@ -57,6 +57,11 @@ exports.port = process.env.PORT || 9001; */ exports.ssl = false; +/** + * socket.io transport methods + **/ +exports.socketTransportProtocols = ['xhr-polling', 'jsonp-polling', 'htmlfile']; + /* * The Type of the database */