From 692fe24b323c0635b9f2f895e30baa933d44accc Mon Sep 17 00:00:00 2001 From: Yann Flory Date: Mon, 11 Apr 2016 14:27:58 +0200 Subject: [PATCH] Ability to use the old Chainpad server in parallel of the netflux server --- ChainPadSrv.js | 1 + server.js | 1 + 2 files changed, 2 insertions(+) diff --git a/ChainPadSrv.js b/ChainPadSrv.js index 4ed6ff840..e2d7a9ef6 100644 --- a/ChainPadSrv.js +++ b/ChainPadSrv.js @@ -177,6 +177,7 @@ var create = module.exports.create = function (socketServer, store) { }; socketServer.on('connection', function(socket) { + if(socket.upgradeReq.url !== '/cryptpad_websocket_old') { return; } socket.on('message', function(message) { try { handleMessage(ctx, socket, message); diff --git a/server.js b/server.js index ce7d6ec49..f3d472dea 100644 --- a/server.js +++ b/server.js @@ -84,5 +84,6 @@ var wsSrv = new WebSocketServer(wsConfig); Storage.create(config, function (store) { console.log('DB connected'); NetfluxSrv.run(store, wsSrv); + ChainPadSrv.create(wsSrv, store); WebRTCSrv.run(wsSrv); });