transports

This commit is contained in:
John McLear 2014-11-04 19:11:06 +00:00
parent cb28d10963
commit 95e7b0f156
1 changed files with 12 additions and 27 deletions

View File

@ -1,10 +1,17 @@
var log4js = require('log4js'); var log4js = require('log4js');
var socketio = require('socket.io');
var settings = require('../../utils/Settings'); var settings = require('../../utils/Settings');
var socketIORouter = require("../../handler/SocketIORouter"); var socketIORouter = require("../../handler/SocketIORouter");
var hooks = require("ep_etherpad-lite/static/js/pluginfw/hooks"); var hooks = require("ep_etherpad-lite/static/js/pluginfw/hooks");
var webaccess = require("ep_etherpad-lite/node/hooks/express/webaccess"); var webaccess = require("ep_etherpad-lite/node/hooks/express/webaccess");
// 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
var socketio = require('socket.io')({
transports: settings.socketTransportProtocols
});
var padMessageHandler = require("../../handler/PadMessageHandler"); var padMessageHandler = require("../../handler/PadMessageHandler");
var connect = require('connect'); var connect = require('connect');
@ -38,32 +45,10 @@ exports.expressCreateServer = function (hook_name, args, cb) {
}); });
}); });
// there shouldn't be a browser that isn't compatible to all // var socketIOLogger = log4js.getLogger("socket.io");
// transports in this list at once // Debug logging now has to be set at an environment level, this is stupid.
// e.g. XHR is disabled in IE by default, so in IE it should use jsonp-polling // https://github.com/Automattic/socket.io/wiki/Migrating-to-1.0
// io.set('transports', settings.socketTransportProtocols ); // This debug logging environment is set in Settings.js
var socketIOLogger = log4js.getLogger("socket.io");
/*
io.set('logger', {
debug: function (str)
{
socketIOLogger.debug.apply(socketIOLogger, arguments);
},
info: function (str)
{
socketIOLogger.info.apply(socketIOLogger, arguments);
},
warn: function (str)
{
socketIOLogger.warn.apply(socketIOLogger, arguments);
},
error: function (str)
{
socketIOLogger.error.apply(socketIOLogger, arguments);
},
});
*/
//minify socket.io javascript //minify socket.io javascript
if(settings.minify) if(settings.minify)