Skip to content

(FROALA-724) - Real-time Collaboration & Cursor Awareness#39

Open
DhivaharM wants to merge 2 commits into
froala:RC-v5.2.1from
CelestialSystem:FROALA-724
Open

(FROALA-724) - Real-time Collaboration & Cursor Awareness#39
DhivaharM wants to merge 2 commits into
froala:RC-v5.2.1from
CelestialSystem:FROALA-724

Conversation

@DhivaharM
Copy link
Copy Markdown

Description

Adds a WebSocket-based collaborative editing relay module (Collaborative) to the SDK, enabling real-time multi-user editing sessions through a room-based broadcast server that shares the existing Express HTTP port.

Related Link

https://iderawebdev.atlassian.net/browse/FROALA-724

Changes Made

  • Change 1: Added lib/collaborative.js — a new module implementing a pure relay WebSocket server. Supports two modes: standalone (createServer) and attached to an existing HTTP/Express server (attachToServer). Manages rooms as in-memory Map<roomName, Set> and broadcasts each message to all other peers in the same room.

  • Change 2: Registered Collaborative in lib/froalaEditor.js so it is exported as FroalaEditor.Collaborative alongside the existing Image, File, Video, and S3 modules.

  • Change 3: Updated examples/server.js to wrap Express in a plain http.Server, attach the collaborative relay to it (Collaborative.attachToServer), and expose a GET /health endpoint that returns live room and client counts via Collaborative.getStats().

  • Change 4: Added ws@^8.20.0 as a production dependency in package.json.

  • Change 5: Added package-lock.json to .gitignore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant