From 44bcd7df05ce3150fff90f0cc1ad5f0a976fd888 Mon Sep 17 00:00:00 2001 From: Kane York Date: Mon, 26 Oct 2015 12:26:47 -0700 Subject: [PATCH] client: Start at random point in round-robin --- src/socket.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/socket.js b/src/socket.js index 08c1f59f..5a2c5e79 100644 --- a/src/socket.js +++ b/src/socket.js @@ -4,7 +4,10 @@ var FFZ = window.FrankerFaceZ, FFZ.prototype._ws_open = false; FFZ.prototype._ws_delay = 0; FFZ.prototype._ws_last_iframe = 0; -FFZ.prototype._ws_host_idx = 0; +FFZ.prototype._ws_host_idx = Math.floor(Math.random() * constants.WS_SERVERS.length) + 1; +if (constants.DEBUG) { + FFZ.prototype._ws_host_idx = 0; +} FFZ.ws_commands = {}; FFZ.ws_on_close = [];