Unspoken (film), Capsulotomy, Battle of An, Allium stamineum.
This commit is contained in:
parent
a884fd4dc9
commit
1fae6a0308
3 changed files with 27 additions and 21 deletions
10
ethersync.el
10
ethersync.el
|
@ -80,7 +80,7 @@
|
||||||
"Send a keep-alive message."
|
"Send a keep-alive message."
|
||||||
;; only send if there is a current socket
|
;; only send if there is a current socket
|
||||||
;; and delete an active timer when there isn't a socket open
|
;; and delete an active timer when there isn't a socket open
|
||||||
(message "heartbeat? %s" (ethersync-current-socket))
|
(message "heartbeat?")
|
||||||
(when (ethersync-current-socket)
|
(when (ethersync-current-socket)
|
||||||
(wss-send "2")
|
(wss-send "2")
|
||||||
(message "heartbeat sent: %s" *etherpad-buffer*))
|
(message "heartbeat sent: %s" *etherpad-buffer*))
|
||||||
|
@ -109,7 +109,8 @@
|
||||||
"Return currently active socket or set SOCKET as current."
|
"Return currently active socket or set SOCKET as current."
|
||||||
(when socket
|
(when socket
|
||||||
(setq ep--current-socket socket))
|
(setq ep--current-socket socket))
|
||||||
(message "current socket: %s in buffer: %s" ep--current-socket *etherpad-buffer*))
|
(message "current socket: set")
|
||||||
|
ep--current-socket)
|
||||||
|
|
||||||
|
|
||||||
;; setters
|
;; setters
|
||||||
|
@ -287,7 +288,7 @@
|
||||||
(nth 2 changes))
|
(nth 2 changes))
|
||||||
(chars
|
(chars
|
||||||
(car (last changes))))
|
(car (last changes))))
|
||||||
;;(message "old length: %s new length: %s ops: %s chars: %s" old-length new-length ops chars)
|
(message "old length: %s new length: %s ops: %s" old-length new-length ops)
|
||||||
(list old-length ops chars)
|
(list old-length ops chars)
|
||||||
)))
|
)))
|
||||||
|
|
||||||
|
@ -425,10 +426,13 @@ use let bindings for multiple connections."
|
||||||
(parsec-collect* (parsec-re "[0-9]+")
|
(parsec-collect* (parsec-re "[0-9]+")
|
||||||
(parsec-many-s (parsec-any-ch))))))
|
(parsec-many-s (parsec-any-ch))))))
|
||||||
(message "frame: %s" (length fr0))
|
(message "frame: %s" (length fr0))
|
||||||
|
(when (= 2 (length fr0))
|
||||||
|
(message "frame: %s" fr0))
|
||||||
(pcase (car frp)
|
(pcase (car frp)
|
||||||
("0" (ethersync--parse-0 frp))
|
("0" (ethersync--parse-0 frp))
|
||||||
("2" (ethersync--parse-2 frp))
|
("2" (ethersync--parse-2 frp))
|
||||||
("3" (message "3: keep-alive"))
|
("3" (message "3: keep-alive"))
|
||||||
|
("40" (message "40: comment"))
|
||||||
("42" (ethersync--parse-42 frp))
|
("42" (ethersync--parse-42 frp))
|
||||||
))))
|
))))
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,9 @@ see https://blog.abrochard.com/websockets.html and [[https://github.com/ahyatt/
|
||||||
|
|
||||||
* protocol, probes & partials
|
* protocol, probes & partials
|
||||||
|
|
||||||
browser client sends url with pad name to server (e.g. https://etherpad.wikimedia.org/p/test ) establishes session (sid) and receives token (in cookie data). updates, changes & pad metadata are sent via wss connection. (e.g. wss://etherpad.wikimedia.org/socket.io/?EIO=3&transport=websocket&sid=Ap47gBZD98dHcW38AoqY )
|
browser client sends url with pad name to server (e.g. https://etherpad.wikimedia.org/p/test ) establishes session (sid) and receives token (in cookie data). updates, changes & pad metadata are sent via wss connection.
|
||||||
|
|
||||||
|
e.g. =wss://etherpad.wikimedia.org/socket.io/?EIO=3&transport=websocket&sid=Ap47gBZD98dHcW38AoqY=
|
||||||
|
|
||||||
** overview
|
** overview
|
||||||
|
|
||||||
|
@ -56,12 +58,11 @@ note right: COLLABROOM
|
||||||
== keep-alive ==
|
== keep-alive ==
|
||||||
client -> ep_server: 2
|
client -> ep_server: 2
|
||||||
ep_server --> client: 3
|
ep_server --> client: 3
|
||||||
|
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
#+CAPTION: overview of etherpad/easysync protocol
|
#+CAPTION: overview of etherpad/easysync protocol
|
||||||
#+ATTR_ORG: :width 400
|
#+ATTR_ORG: :width 400
|
||||||
#+ATTR_LaTeX: :height 15cm :placement [!h]
|
#+ATTR_LaTeX: :height 15cm :placement [H]
|
||||||
[[file:proto-x1.png]]
|
[[file:proto-x1.png]]
|
||||||
|
|
||||||
** comment plugin
|
** comment plugin
|
||||||
|
@ -95,24 +96,25 @@ title comments
|
||||||
|
|
||||||
#+CAPTION: comments
|
#+CAPTION: comments
|
||||||
#+ATTR_ORG: :width 400
|
#+ATTR_ORG: :width 400
|
||||||
#+ATTR_LaTeX: :height 15cm :placement [!h]
|
#+ATTR_LaTeX: :height 15cm :placement [H]
|
||||||
[[file:proto-x2.png]]
|
[[file:proto-x2.png]]
|
||||||
|
|
||||||
** example messages
|
** example messages
|
||||||
|
|
||||||
*init/request*
|
*init/request*
|
||||||
#+BEGIN_SRC text
|
#+BEGIN_SRC
|
||||||
40/comment,
|
40/comment,
|
||||||
|
|
||||||
42/comment,0["getComments",{"padId":"test"}]
|
42/comment,0["getComments",{"padId":"test"}]
|
||||||
42/comment,1["getCommentReplies",{"padId":"test"}]
|
42/comment,1["getCommentReplies",{"padId":"test"}]
|
||||||
|
|
||||||
43/comment,0[{"comments":{"c-4U2BW8J2Lp0r68ZL":{"author":"a.0iRJZx7jiOAxVNMP","name":"zzkt","text":"yes","timestamp":1607769834917}}}]
|
43/comment,0[{"comments":{"c-4U2BW8J2Lp0r68ZL":{"author":"a.0iRJZx7jiOAxVNMP","name":"zzkt","text":"yes","timestamp":1607769834917}}}]
|
||||||
|
|
||||||
43/comment,1[{"replies":{}}]
|
43/comment,1[{"replies":{}}]
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*updates (new)*
|
*updates (new)*
|
||||||
#+BEGIN_SRC text
|
#+BEGIN_SRC
|
||||||
42/comment,["pushAddCommentReply","c-reply-vMSgWSY4bFhaCCLR",{"commentId":"c-4U2BW8J2Lp0r68ZL","text":"no","changeTo":null,"changeFrom":null,"author":"a.0iRJZx7jiOAxVNMP","name":"zzkt","timestamp":1607770300230,"replyId":"c-reply-vMSgWSY4bFhaCCLR"}]
|
42/comment,["pushAddCommentReply","c-reply-vMSgWSY4bFhaCCLR",{"commentId":"c-4U2BW8J2Lp0r68ZL","text":"no","changeTo":null,"changeFrom":null,"author":"a.0iRJZx7jiOAxVNMP","name":"zzkt","timestamp":1607770300230,"replyId":"c-reply-vMSgWSY4bFhaCCLR"}]
|
||||||
|
|
||||||
42/comment,2["getCommentReplies",{"padId":"test"}]
|
42/comment,2["getCommentReplies",{"padId":"test"}]
|
||||||
|
@ -121,13 +123,14 @@ title comments
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*updates (changes)*
|
*updates (changes)*
|
||||||
#+BEGIN_SRC text
|
#+BEGIN_SRC
|
||||||
42/comment,["textCommentUpdated","c-reply-vMSgWSY4bFhaCCLR","not yet"]
|
42/comment,["textCommentUpdated","c-reply-vMSgWSY4bFhaCCLR","not yet"]
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*updates (deletion)*
|
*updates (deletion)*
|
||||||
#+BEGIN_SRC text
|
#+BEGIN_SRC
|
||||||
42/comment,["commentDeleted","c-4U2BW8J2Lp0r68ZL"]
|
42/comment,["commentDeleted","c-4U2BW8J2Lp0r68ZL"]
|
||||||
|
|
||||||
42["message",{"type":"COLLABROOM","data":{"type":"NEW_CHANGES","newRev":234,"changeset":"Z:e>0=7*0=4$","apool":{"numToAttrib":{"0":["comment","comment-deleted"]},"attribToNum":{"comment,comment-deleted":0},"nextNum":1},"author":"a.0iRJZx7jiOAxVNMP","currentTime":1607770511397,"timeDelta":null}}]
|
42["message",{"type":"COLLABROOM","data":{"type":"NEW_CHANGES","newRev":234,"changeset":"Z:e>0=7*0=4$","apool":{"numToAttrib":{"0":["comment","comment-deleted"]},"attribToNum":{"comment,comment-deleted":0},"nextNum":1},"author":"a.0iRJZx7jiOAxVNMP","currentTime":1607770511397,"timeDelta":null}}]
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
@ -165,7 +168,7 @@ If we separate out the operations and convert the numbers to base 10, we get:
|
||||||
|
|
||||||
Here are descriptions of the operations, where capital letters are variables:
|
Here are descriptions of the operations, where capital letters are variables:
|
||||||
|
|
||||||
#+BEGIN_SRC text
|
#+BEGIN_SRC
|
||||||
":N" : Source text has length N (must be first op)
|
":N" : Source text has length N (must be first op)
|
||||||
">N" : Final text is N (positive) characters longer than source text (must be second op)
|
">N" : Final text is N (positive) characters longer than source text (must be second op)
|
||||||
"<N" : Final text is N (positive) characters shorter than source text (must be second op)
|
"<N" : Final text is N (positive) characters shorter than source text (must be second op)
|
||||||
|
@ -215,7 +218,7 @@ Attributes in an attribution string cannot be empty, like "(bold,)", they should
|
||||||
** attributes, colours, authors, etc
|
** attributes, colours, authors, etc
|
||||||
|
|
||||||
the “apool”
|
the “apool”
|
||||||
#+BEGIN_SRC text
|
#+BEGIN_SRC
|
||||||
"apool":{"numToAttrib":{"0":["author","a.touCZaixjPgKDSiN"]},"nextNum":1}
|
"apool":{"numToAttrib":{"0":["author","a.touCZaixjPgKDSiN"]},"nextNum":1}
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
@ -223,7 +226,7 @@ author ids, names & colour mapping
|
||||||
|
|
||||||
** CLIENT_VARS
|
** CLIENT_VARS
|
||||||
|
|
||||||
#+BEGIN_SRC text
|
#+BEGIN_SRC
|
||||||
42["message",{"type":"CLIENT_VARS","data":{… [etc]
|
42["message",{"type":"CLIENT_VARS","data":{… [etc]
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
@ -249,7 +252,7 @@ plugins available
|
||||||
|
|
||||||
example/reduced
|
example/reduced
|
||||||
|
|
||||||
#+BEGIN_SRC js
|
#+BEGIN_SRC
|
||||||
[
|
[
|
||||||
"message",
|
"message",
|
||||||
{
|
{
|
||||||
|
@ -421,7 +424,7 @@ example/reduced
|
||||||
#+end_export
|
#+end_export
|
||||||
* various tools & accessories
|
* various tools & accessories
|
||||||
|
|
||||||
- Firefox/Chrome/Safari -> network/ws/messages/console/log etc
|
- Firefox/Chrome/Safari → network/ws/messages/console/log etc
|
||||||
- =git clone https://github.com/guyzmo/PyEtherpadLite=
|
- =git clone https://github.com/guyzmo/PyEtherpadLite=
|
||||||
- wscat
|
- wscat
|
||||||
- netcat
|
- netcat
|
||||||
|
@ -458,8 +461,7 @@ example/reduced
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
|
||||||
|
#+BEGIN_SRC
|
||||||
#+BEGIN_SRC shell
|
|
||||||
❯ wscat -c "wss://example.org/socket.io/?EIO=3&transport=websocket"
|
❯ wscat -c "wss://example.org/socket.io/?EIO=3&transport=websocket"
|
||||||
Connected (press CTRL+C to quit)
|
Connected (press CTRL+C to quit)
|
||||||
< 0{"sid":"6_TVij3sJug26KFLAAGc","upgrades":[],"pingInterval":25000,"pingTimeout":5000}
|
< 0{"sid":"6_TVij3sJug26KFLAAGc","upgrades":[],"pingInterval":25000,"pingTimeout":5000}
|
||||||
|
@ -467,7 +469,7 @@ example/reduced
|
||||||
>
|
>
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
#+BEGIN_SRC js
|
#+BEGIN_SRC
|
||||||
[
|
[
|
||||||
"message",
|
"message",
|
||||||
{
|
{
|
||||||
|
|
BIN
notes/etherpad-protocol.pdf
Normal file
BIN
notes/etherpad-protocol.pdf
Normal file
Binary file not shown.
Loading…
Reference in a new issue