simple-sandbox-app#
Minimal repro app to prove that Server-Sent Events (SSE) work over a public Vercel Sandbox port.
What this does#
- Serves an HTML page on
/. - Opens an
EventSourceconnection from the browser to/events. - Streams timestamps every 500ms from the server using SSE framing (
data: ...\n\n). - Runs the same app inside a public sandbox and prints a public URL.
Files#
index.ts- Bun server with two routes:/servesindex.html/eventsstreams SSE with appropriate headers
index.html- Vanilla JS client that connects withEventSourceand renders incoming eventsrun-on-sandbox.ts- Creates a Vercel Sandbox, uploads app files, starts Bun, and prints the public URL
Local run#
Install dependencies:
bun install
Start the app locally:
bun run index.ts
Then open:
http://localhost:8081/
Optional stream check from terminal:
curl -N http://localhost:8081/events
Run in Vercel Sandbox (public port repro)#
bun run run-on-sandbox.ts
The script prints a public URL for port 8081. Open that URL and verify:
- The page status becomes
connected - New timestamp events keep appearing
This is the repro target: SSE remains functional when exposed via a public Sandbox port.