File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -71,3 +71,27 @@ And a simplistic example:
7171For a full-featured example see the
7272[ /examples/sockjs] ( https://github.com/sockjs/websocket-multiplex/tree/master/examples/sockjs )
7373directory.
74+
75+
76+ Protocol
77+ --------
78+
79+ The underlying protocol is quite simple. Each message consists of
80+ three comma separated parts: _ type_ , _ topic_ and _ payload_ . There are
81+ three valid message types:
82+
83+ * ` sub ` - expresses a will to subscribe to a given _ topic_ .
84+ * ` msg ` - a message with _ payload_ is being sent on a _ topic_ .
85+ * ` uns ` - a will to unsubscribe from a _ topic_ .
86+
87+ Invalid messages like wrong unsubscriptions or publishes to a _ topic_
88+ to which a client was not subscribed to are simply ignored.
89+
90+ This protocol assumes that both parties are genrally willing to
91+ copperate and no party can express any kind of errors. All invalid
92+ messages should be ignored.
93+
94+ It's important to notice that the namespace is shared between both
95+ parties and it is not a good idea to use the same topic names on the
96+ client and on the server side. Both parties may express a will to
97+ unsubscribe itself or other party from a topic.
You can’t perform that action at this time.
0 commit comments