allow for load testing connections to hit by a setting

This commit is contained in:
John McLear 2015-02-16 23:02:19 +00:00
parent e39b442840
commit ec6a2b5ba9
3 changed files with 14 additions and 2 deletions

View File

@ -108,6 +108,9 @@
// restrict socket.io transport methods
"socketTransportProtocols" : ["xhr-polling", "jsonp-polling", "htmlfile"],
// Allow Load Testing tools to hit the Etherpad Instance. Warning this will disable security on the instance.
"loadTest": false,
/* The toolbar buttons configuration.
"toolbar": {

View File

@ -23,8 +23,12 @@ exports.expressCreateServer = function (hook_name, args, cb) {
io.use(function(socket, accept) {
var data = socket.request;
if (!data.headers.cookie) return accept('No session cookie transmitted.', false);
// Use a setting if we want to allow load Testing
if(!data.headers.cookie && settings.loadTest){
accept(null, true);
}else{
if (!data.headers.cookie) return accept('No session cookie transmitted.', false);
}
// Use connect's cookie parser, because it knows how to parse signed cookies
connect.cookieParser(webaccess.secret)(data, {}, function(err){
if(err) {

View File

@ -144,6 +144,11 @@ exports.loglevel = "INFO";
*/
exports.disableIPlogging = false;
/**
* Disable Load Testing
*/
exports.loadTest = false;
/*
* log4js appender configuration
*/