Pergunta

I'm trying to program a Webpage, which allows to edit a text document simultaneously.

To program something like a Chat in Node.js is not very difficult, but working on the same text makes it kinda tricky. I thought about sending the char position and the changes characters, but if someone types something previous to the change, the change would be placed on the wrong position.

What's the best way to exchange Modifications between my clients?

Foi útil?

Solução

You should use Socket.io to have make your Real-Time application.

I just founded a nice blog article which speaks about real time edition, see here. It's also providing a link to the github project and to an open source online editor project. Take a look and try to understand how they do stuff like this, good luck !

Outras dicas

Two people cannot be manipulating the same object at the same time from a different place. You basically have two choices. 1. Let them take turns with the object 2. duplicate it if they both want it, but that doesnt sound like it would end well

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top