Configuring Collaborative Editing
WebDigAIRange supports real-time collaborative editing powered by Y.js - a high-performance CRDT framework that synchronizes shared document states across users.
To enable this functionality, WebDigAIRange requires a Y.js WebSocket backend.
This backend handles synchronization between multiple connected clients, ensuring that edits are merged consistently and efficiently.
This document explains how to set up the backend using the open-source project yjs/y-websocket and host it securely via Docker and a reverse proxy.
Deployment via Docker
The easiest way to deploy the Y.js WebSocket backend is to use a ready-to-run Docker image.
Below is an example docker-compose.yml configuration:
services:
y-websocket:
container_name: y-websocket
image: alokinplc/y-websocket:latest
restart: always
ports:
- 1234:1234
This configuration starts a persistent WebSocket server that listens on port 1234.
Once the container is running, clients can connect directly to ws://<server-address>:1234 for development or testing purposes.
Enabling Secure Access
For production environments, it is strongly recommended to run the WebSocket backend behind a reverse proxy that provides TLS/HTTPS termination and secure routing.
A typical setup involves using NGINX, Caddy, or Traefik to forward incoming HTTPS requests from a public domain to the internal Docker container:
https://my-y-websocket.mydomain.com:1235 → http://127.0.0.1:1234
This ensures:
Encrypted client–server communication (using HTTPS/WSS)
Simplified certificate management (e.g., via Let’s Encrypt)
Controlled network access and rate limiting
Compatibility with browser security policies (WSS required for HTTPS sites)
Once configured, WebDigAIRange clients should connect using the secure WebSocket URL:
wss://my-y-websocket.mydomain.com