emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A new collaborative editing package (maybe tangent)


From: Yuan Fu
Subject: Re: A new collaborative editing package (maybe tangent)
Date: Sat, 30 Dec 2023 12:09:36 -0800


> On Dec 30, 2023, at 12:56 AM, Arne Babenhauserheide <arne_bab@web.de> wrote:
> 
> Yuan Fu wrote:
>> My goal for collab-mode is for it to be a p2p, cross-editor, real-time
>> collab editing package (Emacs collab with Vim!). It works kind of like
>> language servers (LSP): a local “collab server” (called collab
>> process) talks to the editor over JSONRPC, and collab processes talk
>> among themselves over the internet. Most of the hard work is done by
>> the collab process and the editor end should be relatively easy to
>> implement.
> 
> This sounds pretty interesting!
> 
>> As of right now, collab-mode has these features:
>> - Sharing a plain text file
>> - Sharing a directory (still have rough edges)
> 
> Does it work well with editing modes? Plain text can be a loose definition 
> with Emacs :-)

Plain text as opposed to rich text (which is usually stored in some internal 
tree structure).

> 
> Example: When I run a plantuml code block in an org file in a shared 
> directory, will the other side see the generated diagram inline?
> 
>> - Undo & redo (linear)
>> - Builtin NAT traversal
> 
> How do you achieve NAT traversal?
> (that's interesting to me from a technical / sharing techniques viewpoint; 
> would love to pass it on to students in a lecture in spring)

I used webrtc. Rust has a native implementation for it, other languages 
probably have bindings to libwebrtc. Specifically, webrtc uses ICE (and STUN 
and TURN) protocol for NAT traversal, and webrtc itself defines a data channel 
abstraction on top of them.

The stack roughly looks like this:

-------------------------------------
Data channel protocol
-------------------------------------
SCTP - congestion and flow control
-------------------------------------
DTLS - security
-------------------------------------
UDP & ICE - transport & NAT traversal
-------------------------------------

> I've seen that you use a signaling server, does this manage to enable direct 
> connections between two NAT'ed computers?

Right.

> 
>> |🧚 No shared docs, not here, not now.                      |
>> |Let’s create one, and here’s how!                          |
> 
> I would suggest "here is how" instead of "and here's how".
> That better matches the rhythm of the first line :-)
> 
>> |🧚 Your file is shared, and here’s the link                |
>> |Anyone can connect with just a click!                      |
> 
> Anyone -> All
> (also for rhythm)
> 
> Though that's less precise, since if "All" tried to connect, they would 
> likely break something.
> 
>> Help with rhymes
>> ================
>> 
>> I hope you don’t find the fairy and her bad rhymes annoying. I’m not
>> very good at rhymes, chatgpt is even worse. If you can come up with
>> better ones, please do send them along :-)
> 
> I hope the suggestions help :-)

Thanks, they help a lot :-)

> 
> How could I run a signaling server myself?

In the repo there are actually two binaries. One is collab-mode, the other is 
collab-signal, the signaling server.

You can run the signaling server by 

    make signaling

Or equivalently 

    cargo run --bin collab-signal -- run --port <port>

Yuan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]