[READ-ONLY] Mirror of https://github.com/Schniz/simple-sandbox-sse-app.
0

Configure Feed

Select the types of activity you want to include in your feed.

TypeScript 66.5%
HTML 33.5%
1 1 0

Clone this repository

https://tangled.org/schlez.in/simple-sandbox-sse-app https://tangled.org/did:plc:ejdorpaxpylxzvdmmlek4nhc
git@tangled.org:schlez.in/simple-sandbox-sse-app git@tangled.org:did:plc:ejdorpaxpylxzvdmmlek4nhc

For self-hosted knots, clone URLs may differ based on your setup.



README.md

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 EventSource connection 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:
    • / serves index.html
    • /events streams SSE with appropriate headers
  • index.html - Vanilla JS client that connects with EventSource and renders incoming events
  • run-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.