Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

968 B
Raw Blame

Browser WebSocket delivery

A paired or signed-in direct browser receives live chat updates over a WebSocket on /api/events; commands still go over HTTP. The socket becomes live after a valid hello. After three seconds visible and online without a hello, or after a disconnect, the browser reconnects with backoff and resumes from its last committed cursor.

The event stream (SSE) on the same path stays the fallback. A browser whose first socket never says hello (a proxy that blocks upgrades, or a browser this server keeps on the event stream, such as one on this computer that is not paired) switches to the event stream for the rest of the page's life. A browser whose socket has worked before switches after three failed handshakes in a row. Desktop and encrypted phone relay clients keep their existing transports.

The server authorization, heartbeat and revocation check:

OMB_CDP_CHROME=/usr/bin/chromium node scripts/verify-websocket-feed.ts