more flexible websocket configuration (WIP)

This commit is contained in:
ansuz
2016-10-03 19:19:38 +02:00
parent 9fa7da60b9
commit 3dfa19b786
3 changed files with 18 additions and 4 deletions

View File

@@ -277,7 +277,7 @@ let run = module.exports.run = function (storage, socketServer, config) {
});
}, 5000);
socketServer.on('connection', function(socket) {
if(socket.upgradeReq.url !== '/cryptpad_websocket') { return; }
if(socket.upgradeReq.url !== (config.websocketPath || '/cryptpad_websocket')) { return; }
let conn = socket.upgradeReq.connection;
let user = {
addr: conn.remoteAddress + '|' + conn.remotePort,