It’s a big title, but the technology behind a simple collaborative editing textarea can be simple and interesting.

By using a derivative work from pubsub_ws along with diff match patch, it was possible to broadcast patches (yes, the same kind of patches you can create with diff -a) between peers using websockets and javascript.

The most interesting part is that I’m not a js expert, but I built the entire stack only using this language, from frontend to backend. There is also a patch to enable diff match patch to be used from node.js.

Here is the code