From a5d541dafccff41fcfb0bc7cd0485e2dda2d40cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 11 Apr 2018 18:47:08 +0200 Subject: [PATCH] Fix sockjs not working behind haproxy For some reason the websocket connection runs into a timeout, the xhr transport doesn't properly take over, and then stuff takes ages to realign again. Only happens under Tornado 5, doesn't happen under Tornado 4.5 Increasing the timeout for now instead of pinning to Tornado 4.5 in the hopes that might still be figured out. Incredibly weird though. --- src/octoprint/static/js/lib/sockjs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/octoprint/static/js/lib/sockjs.js b/src/octoprint/static/js/lib/sockjs.js index f168d5f7b..52431ec9e 100644 --- a/src/octoprint/static/js/lib/sockjs.js +++ b/src/octoprint/static/js/lib/sockjs.js @@ -818,7 +818,7 @@ SockJS.prototype._connect = function() { } // calculate timeout based on RTO and round trips. Default to 5s - var timeoutMs = (this._rto * Transport.roundTrips) || 5000; + var timeoutMs = (this._rto * Transport.roundTrips * 2) || 5000; this._transportTimeoutId = setTimeout(this._transportTimeout.bind(this), timeoutMs); debug('using timeout', timeoutMs);