forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on mainFiltered to src-tauri/Cargo.lockClear filter

2026-08-23

Package the web app for Android and iOS with Tauri v2Burak Boduroğlu · 78656e4
Package the web app for Android and iOS with Tauri v2

The web app is served same-origin with the backend today: it fetches
"/api/..." with same-origin credentials, points <img src> at /api so the
session cookie authenticates image requests, opens an EventSource on
/api/chatbot, and derives its exam-room and whiteboard WebSocket URLs from
window.location.host. A webview loaded from tauri://localhost breaks all of
it, so rather than refactor ~40 call sites and move the backend to CORS plus
token auth, this reproduces the frontend's server.ts inside the app: a
loopback HTTP server serves the bundled SPA and reverse-proxies /api/* — HTTP
and WebSocket — to the backend. The frontend is vendored unchanged as a
submodule.

Two details make the illusion hold: the port is fixed, because the session
cookie is scoped to 127.0.0.1:<port> and a moving port would sign the user
out on every launch; and Set-Cookie has Domain and Secure stripped, because
the backend mints the cookie for its own host over TLS and the webview would
otherwise drop it on a plain-HTTP loopback origin.