This protocol sits on top of something like a websocket or similar transport layer.
- Server says hello, also tells you your sessionid
[0,":HELLO:",{sessionId:"<sessionid>"}]
- Client subscribes to a bunch of channels (not including "sessionid" or "*")
[0,":SUB:",{channels:["x","y","z"]}]
- Client publishes a value over a channel
[1,"*","ridXYZ",["Hello"]]
- Server publishes a wrapped message to the "*" channel
[2,"<sessionid>",[1,"*","ridXYZ",["Hello"]]]
- Other Client decides to say hello back
[1,"<originalsessionid>","",["ShakeHands"],{replyId:"ridXYZ"}]]
- Original client hears the hello back
[2,"<remotesessionid>",[1,"<originalsessionid>","",["ShakeHands"],{replyId:"ridXYZ"}]]