A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/TimoWilhelm/yjs-cf-ws-provider below:

TimoWilhelm/yjs-cf-ws-provider: A WebSocket Provider for Yjs running on Cloudflare Workers

Note

This project is intended for learning purposes and demonstration of the Cloudflare Workers and Durable Objects APIs. If you are looking for a production-ready solution, check out PartyKit which also supports the Yjs API.

This project implements a Serverless Yjs WebSocket provider using Cloudflare Workers + Durable Objects to relay messages between clients. It is fully compatible with the Yjs WebSocket Connector.

This project uses the Cloudflare Durable Objects WebSocket Hibernation API to terminate WebSocket connections to avoid incurring duration charges when the connection is idle.

It also periodically saves the Yjs document state to a Cloudflare R2 storage bucket and clears the partial updates from the Durable Object storage. The vacuum interval can be configured with the YJS_VACUUM_INTERVAL_IN_MS environment variable. The default is 30 seconds.

This will start a local server using the Wrangler CLI and serve a demo app. You can open a browser to the URL that is displayed in the console to test it with a simple TipTap editor.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4