⭐ Starforge is a pixel art & animation studio that runs in your browser.
Last time the relay queue was in memory. Now it is a real wire using native WebSocket to talk with the relay I wrote by hand on node:http, handshake, framing, mask, fragmentation, ping/pong, close codes, all of it. Draw a horizontal stroke here, a vertical one there, and both canvases land on the same pixels.
900 pixels travel in 2,730 bytes. Raw it would be 7,200 (8 bytes per pixel: u16 x, u16 y, u32 color). On the wire the cells sort by (y, x), coordinates go as zigzag deltas, colors go as an index into a 1-entry table. That is 3.033 bytes per pixel, and every one of the 19 operation kinds round-trips byte-for-byte. The server does not trust a single byte, each op is validated with the same applyOperation the editor uses, on a clone. A bad op earns an ERROR and the connection stays open.
Receipts:
- 662 unit tests green
- 23 Chromium E2E
- zero production dependencies
Next: the ephemeral room becomes shareable rooms /r/<id>
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.