Skip to content

Instantly share code, notes, and snippets.

@lfryc
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lfryc/c50c0832a38470b1b9f4 to your computer and use it in GitHub Desktop.
Save lfryc/c50c0832a38470b1b9f4 to your computer and use it in GitHub Desktop.
ws: open
ws1: init
WebSocket.send {"msgType":"add","id":"81082ff9-a3b5-421e-87fa-109c893c871b","clientId":"client1","content":"Do or do not, there is no try."}
ws2: init
WebSocket.send {"msgType":"add","id":"81082ff9-a3b5-421e-87fa-109c893c871b","clientId":"client2"}
ws2: sent
ws: open
ws1: init
WebSocket.send {"msgType":"add","id":"7a01a11a-0779-4ad2-86a6-fa80e46862ac","clientId":"client1","content":"Do or do not, there is no try."}
ws1: onmessage 0
ws2: init
WebSocket.send {"msgType":"add","id":"7a01a11a-0779-4ad2-86a6-fa80e46862ac","clientId":"client2"}
ws2: sent
WebSocket.send {"msgType":"patch","id":"7a01a11a-0779-4ad2-86a6-fa80e46862ac","clientId":"client1","edits":[{"clientVersion":0,"serverVersion":0,"checksum":"","diffs":[{"operation":"UNCHANGED","text":"Do or do not, there is no try"},{"operation":"DELETE","text":"."},{"operation":"ADD","text":"!"}]}]}
ws1: onmessage 1
ws2: onmessage 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment