yosegaki
Collaborative editing server for Vim. The client is vim-yosegaki.
One server runs many sessions at once. Each session has a host who chooses public (anyone with the id can view, editors need the host's approval) or private (guests need the host's approval to enter). Edits are merged with operational transformation.
Installation
Download a binary from Releases, or
go install github.com/mattn/yosegaki@latest
The same binary is needed on every machine running Vim: yosegaki connect relays between Vim (job stdio) and the server (WebSocket over TLS), since Vim channels cannot speak either.
Docker
docker run -d -p 8080:8080 ghcr.io/mattn/yosegaki
Usage
yosegaki serve -addr :8080 # run the server
-max-memory 96 # MB for documents, history and send queues
yosegaki connect URL # stdio bridge used by vim-yosegaki
yosegaki list URL # print public sessions as JSON
Endpoints:
/ws WebSocket for clients
/sessions public sessions as JSON
Run it behind a TLS reverse proxy that passes WebSocket upgrades, for example with nginx:
location / {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 1h;
}
Sessions live in memory and end when the host disconnects.
Client IPs come from CF-Connecting-IP, then X-Forwarded-For, then the peer address, so run it behind a proxy that sets them; exposed directly, clients could forge them to dodge the per-IP limits (the memory budget still holds).
Limits: documents up to 1MB, 32 people per session, 16 connections per IP, 10 new sessions per IP per minute, 256 connections in total. When the memory budget runs out, new sessions and growing edits are refused instead of the server running out of memory.
License
MIT
Author
Yasuhiro Matsumoto (a.k.a. mattn)