diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-08 03:29:35 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-08 03:29:35 +0100 |
| commit | 058432130628d00764663ecf819a9adc6793768d (patch) | |
| tree | d3f49f111fbfaa48647cca2600adcf9017af2d30 /web/nginx.conf.example | |
| parent | web: serve latest.php through PHP and refuse stray PHP files (diff) | |
| download | zagan-bet-058432130628d00764663ecf819a9adc6793768d.tar.gz zagan-bet-058432130628d00764663ecf819a9adc6793768d.zip | |
v5.0.0: protocol v5 and the browser frontend
Protocol v5 replaces newline lines with bounded [u32 len][text] frames and REQ/RES/EVT envelopes. Requests carry correlation ids and the server replays the last 256 replies per connection, so a gateway retry cannot double-debit and a late reply cannot clobber a newer request. HELLO/PONG carry server time; crash rounds announce started_at and push coalesced 10 Hz ticks. Crash now commits sha256(seed) before a round and reveals the seed when it ends, so clients recompute the crash point.
Adds the webd/ gateway: one blocking thread, one ClientCore and one pinned upstream TLS connection per session, an HttpOnly session cookie, takeover, and a 60-second grace window. The browser sends Command JSON and renders View JSON; it never speaks the game protocol or stores credentials.
Adds the vanilla TypeScript browser app at /play/ (login, lobby, all four games, history, notices, crash verification), the nginx /play and /ws routes, and the headless DOM smoke test. webd and the app stay out of the TUI/GUI/server build graph.
The client/server version moves to 5.0.0 in lockstep; v4 peers are refused at HELLO.
Diffstat (limited to '')
| -rw-r--r-- | web/nginx.conf.example | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/web/nginx.conf.example b/web/nginx.conf.example index 9fc942f..d440ab5 100644 --- a/web/nginx.conf.example +++ b/web/nginx.conf.example | |||
| @@ -37,6 +37,31 @@ server { | |||
| 37 | add_header Cache-Control "public, max-age=31536000, immutable"; | 37 | add_header Cache-Control "public, max-age=31536000, immutable"; |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | # The browser app: static files, no framework runtime. | ||
| 41 | location = /play { | ||
| 42 | return 301 /play/; | ||
| 43 | } | ||
| 44 | |||
| 45 | location /play/ { | ||
| 46 | try_files $uri $uri/ /play/index.html; | ||
| 47 | add_header Cache-Control "no-cache"; | ||
| 48 | add_header X-Frame-Options "DENY" always; | ||
| 49 | add_header X-Content-Type-Options "nosniff" always; | ||
| 50 | } | ||
| 51 | |||
| 52 | # WebSocket gateway. Keep the upgrade headers and a long read timeout: | ||
| 53 | # a crash round can idle for a while between pushes. | ||
| 54 | location = /ws { | ||
| 55 | proxy_pass http://127.0.0.1:8890; | ||
| 56 | proxy_http_version 1.1; | ||
| 57 | proxy_set_header Upgrade $http_upgrade; | ||
| 58 | proxy_set_header Connection "upgrade"; | ||
| 59 | proxy_set_header Host $host; | ||
| 60 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
| 61 | proxy_read_timeout 3600s; | ||
| 62 | proxy_send_timeout 3600s; | ||
| 63 | } | ||
| 64 | |||
| 40 | # The page rescans bin/ on every request, so don't cache it. | 65 | # The page rescans bin/ on every request, so don't cache it. |
| 41 | location = /index.php { | 66 | location = /index.php { |
| 42 | include fastcgi_params; | 67 | include fastcgi_params; |
