Files
Johnny322 f440118fef
All checks were successful
Deploy Feature / deploy-feature (push) Successful in 25s
Add possibility to guess as a player
2026-03-01 22:19:34 +01:00
..
2026-02-24 20:54:14 +01:00

Realtime Sessions

This app now supports shared sessions by gameId using a lightweight WebSocket server.

Run

npm run realtime:server

Default port: 8787
Override: REALTIME_PORT=9000 npm run realtime:server

Nginx Proxy

Proxy /realtime/* from your public domain to the realtime server:

location /realtime/ {
    proxy_pass http://127.0.0.1:8787/;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
}

Notes:

  • proxy_pass with trailing / is important, because frontend calls /realtime/sessions and /realtime/ws.
  • Sessions are kept in memory; restarting the realtime server resets all active game sessions.