diff --git a/src/backend/backendmodule.js b/src/backend/backendmodule.js index 2fcb7ee7..c9cfd8bc 100644 --- a/src/backend/backendmodule.js +++ b/src/backend/backendmodule.js @@ -37,7 +37,8 @@ class BackendModule { const redisClientProvider = this.getRedisClientProvider(); this.redisAdapter = redisAdapter({ pubClient: redisClientProvider.get(), - subClient: redisClientProvider.get() + // return_buffers is needed for msgpack-js to function correctly + subClient: redisClientProvider.get({ return_buffers: true }) }); this.sioEmitter = require('socket.io').instance; this.sioEmitter.adapter(this.redisAdapter); diff --git a/www/js/callbacks.js b/www/js/callbacks.js index fd6b47ec..67b2d6dc 100644 --- a/www/js/callbacks.js +++ b/www/js/callbacks.js @@ -1119,8 +1119,17 @@ setupCallbacks = function() { return; } + var servers; + if (socketConfig.alt && socketConfig.alt.length > 0 && + localStorage.useAltServer) { + servers = socketConfig.alt; + console.log("Using alt servers: " + JSON.stringify(servers)); + } else { + servers = socketConfig.servers; + } + var chosenServer = null; - socketConfig.servers.forEach(function (server) { + servers.forEach(function (server) { if (chosenServer === null) { chosenServer = server; } else if (server.secure && !chosenServer.secure) { @@ -1130,6 +1139,8 @@ setupCallbacks = function() { } }); + console.log("Connecting to " + JSON.stringify(chosenServer)); + if (chosenServer === null) { makeAlert("Error", "Socket.io configuration was unable to find a suitable server",