@playfast/reform-remote-node
v1.0.1
Published
Node WebSocket server adapter for reform-remote — serves a reform scene's UI over the `ws` package, one isolated runtime per connection.
Maintainers
Readme
@playfast/reform-remote-node
Serve a reform scene's UI over WebSocket from Node, using the ws package.
A concrete WebSocket server adapter for
@playfast/reform-remote. The scene runs
once as a single shared runtime (serveShared); every connection attaches to it via addClient,
so all clients see and drive the same state. Sockets are wrapped with JSON framing — the wire
messages are already _tag-discriminated and serializable, so there is no envelope to write.
import { serveNodeWebSocket } from '@playfast/reform-remote-node'
import { myScene } from './scene'
const host = serveNodeWebSocket({ scene: myScene, port: 8080 })
// …later
await host.stop()Pass server to attach to an existing HTTP server instead of opening a port, and path to
restrict upgrades. Connect from the browser (or Node/Bun) with
@playfast/reform-remote-web; the
Bun-native server equivalent is
@playfast/reform-remote-bun.
License
MIT
