This project is a demo running a yjs webrtc peer on nodejs via Docker using node-webrtc.
- Make sure you have Docker installed on your computer
- Clone the repository and build the docker container by running
docker build --platform linux/amd64 -t yjswebrtc-node .
Replace yjswebrtc-node with any name of your choosing.
- Then run the docker container using
docker run --platform linux/amd64 -it yjswebrtc-node
Again, replacing yjswebrtc-node with the name you chosed previously.
You should get an output such as
Listening on port 3000
synced! { synced: true }
yText
... then the app is working properly!
y-webrtc relies on the websockets module in lib0
module which itself depends on WebSocket
support.
However, Node does not natively support WebSocket so I ended up publishing a separate version of the module lib0-server-ws
which includes WebSocket
from ws
.