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.
This commit is contained in:
Gina Häußge committed 2018-04-11 18:47:08 +02:00
1 parent 258f3725bf
commit a5d541dafc
1 file changed
+1 -1
+1 -1
View File
@@ -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);