mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-16 13:56:53 +00:00
Add tunnel timeout to support websocket connections (#11708)
HomeAssistant uses a 55 second interval[1] to send heartbeats to
the Lovelace UI over WebSockets. If the tunnel timeout[2] is not
set, the WebSocket connection from the browser to the server is
reset every 50 seconds. When the connection resets, it reconnects
automatically, and causes the page to reload. Any unsaved data in
forms is lost.
This commit adds a sane default of 60 seconds to the HAProxy
configuration for tunneled connections, so that the frontend
WebSocket connection doesn't time out every 50 seconds.
[1]: 9c551ae85d/homeassistant/components/websocket_api/http.py (L111)
[2]: https://cbonte.github.io/haproxy-dconv/1.8/configuration.html#4-timeout%20tunnel
Related: home-assistant/home-assistant-js-websocket#108
This commit is contained in:
parent
ce07145f14
commit
59cc1f0d18
@ -57,7 +57,8 @@ defaults
|
||||
timeout connect 5000
|
||||
timeout client 50000
|
||||
timeout server 50000
|
||||
timeout http-request 5s #protection from Slowloris attacks
|
||||
timeout tunnel 60000 # long enough for websocket pings every 55 seconds
|
||||
timeout http-request 5s # protection from Slowloris attacks
|
||||
|
||||
frontend www-http
|
||||
bind *:80
|
||||
|
Loading…
x
Reference in New Issue
Block a user