From 8b044254cc4d6c5413b6426d0cd13b4b44c04e6f Mon Sep 17 00:00:00 2001 From: Wikinaut Date: Sun, 2 Dec 2012 18:28:28 +0100 Subject: [PATCH 1/7] add socketTransportProtocols parameter --- settings.json.template | 7 +++++++ src/node/hooks/express/socketio.js | 4 ++-- src/node/utils/Settings.js | 8 ++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/settings.json.template b/settings.json.template index 4894f897d..815009c27 100644 --- a/settings.json.template +++ b/settings.json.template @@ -29,6 +29,13 @@ */ + // restricts socket.io transport methods to JSONP-POLLING only + // which is needed for IE8 browsers with deactivated native XMLHTTP support + // see issue https://github.com/ether/etherpad-lite/pull/958 + // and https://github.com/ether/etherpad-lite/issues/245#issuecomment-4013455 + + "socketTransportProtocols" : ['xhr-polling', 'jsonp-polling', 'htmlfile'], + //The Type of the database. You can choose between dirty, postgres, sqlite and mysql //You shouldn't use "dirty" for for anything else than testing or development "dbType" : "dirty", 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..2a7714979 100644 --- a/src/node/utils/Settings.js +++ b/src/node/utils/Settings.js @@ -57,6 +57,14 @@ exports.port = process.env.PORT || 9001; */ exports.ssl = false; +/** + * restricts socket.io transport methods to JSONP-POLLING only + * which is needed for IE8 browsers with deactivated native XMLHTTP support + * see issue https://github.com/ether/etherpad-lite/pull/958 + * and https://github.com/ether/etherpad-lite/issues/245#issuecomment-4013455 + **/ +exports.socketTransportProtocols = ['xhr-polling', 'jsonp-polling', 'htmlfile']; + /* * The Type of the database */ From 9224e9beefa4658c8db5701e3d30a6bb7eabaca8 Mon Sep 17 00:00:00 2001 From: Wikinaut Date: Sun, 2 Dec 2012 18:44:39 +0100 Subject: [PATCH 2/7] removed wrong comment in Settings.js --- src/node/utils/Settings.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/node/utils/Settings.js b/src/node/utils/Settings.js index 2a7714979..bed5a9a07 100644 --- a/src/node/utils/Settings.js +++ b/src/node/utils/Settings.js @@ -58,10 +58,7 @@ exports.port = process.env.PORT || 9001; exports.ssl = false; /** - * restricts socket.io transport methods to JSONP-POLLING only - * which is needed for IE8 browsers with deactivated native XMLHTTP support - * see issue https://github.com/ether/etherpad-lite/pull/958 - * and https://github.com/ether/etherpad-lite/issues/245#issuecomment-4013455 + * socket.io transport methods **/ exports.socketTransportProtocols = ['xhr-polling', 'jsonp-polling', 'htmlfile']; From 38c65490581275ad0e4dcb2a1c3cad50787da346 Mon Sep 17 00:00:00 2001 From: Wikinaut Date: Sun, 2 Dec 2012 18:47:06 +0100 Subject: [PATCH 3/7] removed wrong comment in settings.json.template --- settings.json.template | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/settings.json.template b/settings.json.template index 815009c27..b33864813 100644 --- a/settings.json.template +++ b/settings.json.template @@ -29,10 +29,7 @@ */ - // restricts socket.io transport methods to JSONP-POLLING only - // which is needed for IE8 browsers with deactivated native XMLHTTP support - // see issue https://github.com/ether/etherpad-lite/pull/958 - // and https://github.com/ether/etherpad-lite/issues/245#issuecomment-4013455 + // restricts socket.io transport methods "socketTransportProtocols" : ['xhr-polling', 'jsonp-polling', 'htmlfile'], From 9701c51ac5f6774ad2be52dc5fcfcfa14235045b Mon Sep 17 00:00:00 2001 From: Wikinaut Date: Sun, 2 Dec 2012 18:48:47 +0100 Subject: [PATCH 4/7] removed empty line in settings.json.template --- settings.json.template | 1 - 1 file changed, 1 deletion(-) diff --git a/settings.json.template b/settings.json.template index b33864813..b1c2404fe 100644 --- a/settings.json.template +++ b/settings.json.template @@ -30,7 +30,6 @@ */ // restricts socket.io transport methods - "socketTransportProtocols" : ['xhr-polling', 'jsonp-polling', 'htmlfile'], //The Type of the database. You can choose between dirty, postgres, sqlite and mysql From 0d2eddb62a286f48f742941cedc5af96958dcad0 Mon Sep 17 00:00:00 2001 From: Wikinaut Date: Sun, 2 Dec 2012 18:54:30 +0100 Subject: [PATCH 5/7] console.debug socketTransportProtocols --- src/node/utils/Settings.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/node/utils/Settings.js b/src/node/utils/Settings.js index bed5a9a07..45817e849 100644 --- a/src/node/utils/Settings.js +++ b/src/node/utils/Settings.js @@ -177,6 +177,7 @@ exports.reloadSettings = function reloadSettings() { if(exports.dbType === "dirty"){ console.warn("DirtyDB is used. This is fine for testing but not recommended for production.") } + console.debug("socket.io uses "+exports.socketTransportProtocols); } // initially load settings From 05e8c74307dcef8471e2d2e55ea8b98d49829dbb Mon Sep 17 00:00:00 2001 From: Wikinaut Date: Mon, 10 Dec 2012 22:33:00 +0100 Subject: [PATCH 6/7] removed console.log of transport protocols --- src/node/utils/Settings.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/node/utils/Settings.js b/src/node/utils/Settings.js index 45817e849..bed5a9a07 100644 --- a/src/node/utils/Settings.js +++ b/src/node/utils/Settings.js @@ -177,7 +177,6 @@ exports.reloadSettings = function reloadSettings() { if(exports.dbType === "dirty"){ console.warn("DirtyDB is used. This is fine for testing but not recommended for production.") } - console.debug("socket.io uses "+exports.socketTransportProtocols); } // initially load settings From e1a15400119c4ce6376f3a43eb8d962c49509698 Mon Sep 17 00:00:00 2001 From: Wikinaut Date: Mon, 10 Dec 2012 23:46:54 +0100 Subject: [PATCH 7/7] moved to settings.json.template bottom; chg gitignore --- .gitignore | 1 + settings.json.template | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) 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 897533f51..e37bc4509 100644 --- a/settings.json.template +++ b/settings.json.template @@ -29,9 +29,6 @@ */ - // restricts socket.io transport methods - "socketTransportProtocols" : ['xhr-polling', 'jsonp-polling', 'htmlfile'], - //The Type of the database. You can choose between dirty, postgres, sqlite and mysql //You shouldn't use "dirty" for for anything else than testing or development "dbType" : "dirty", @@ -94,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'] }