Fix web map blanking and websocket dropping behind a reverse proxy
- web-map: main() was bound to the whole site state, so every state update (e.g. each player position update over the websocket) re-rendered the page and re-attached the Leaflet map to a new element, blanking the tiles. Only re-render when the view, server list, or map instance changes. - web-map: reconnect the websocket when it closes, instead of silently stopping live updates. - events-server-web: send websocket pings every 30s, so idle connections aren't closed by reverse proxies (nginx defaults to a 60s read timeout). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
cae2eb09c6
commit
d6d9444723
3 changed files with 26 additions and 7 deletions
|
|
@ -13,6 +13,9 @@ fun Application.webmapWebsocketServer(
|
|||
wsServer: WebmapWebsocketServer,
|
||||
) {
|
||||
install(WebSockets) {
|
||||
// keep idle connections alive through reverse proxies (e.g. nginx closes after 60s by default)
|
||||
pingPeriodMillis = 30_000
|
||||
|
||||
extensions {
|
||||
install(WebSocketDeflateExtension) {
|
||||
// Compression level to use for java.util.zip.Deflater
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue