-
Notifications
You must be signed in to change notification settings - Fork 3
Protocol
Traffic Cop uses a binary protocol for exchanging messages. I've tried to keep the protocol simple and obvious, so if you'd like to write a client in the language of your choice, it should be straightforward. There are two kinds of messages:
That are sent from the client to the server, contain information on what channel to publish the data on and the actual data itself. They have the format:
That are sent from the client to the server, contain information on the channels the client would like to subscribe to. This is a comma seperated list of channels, so having a channel name with a comma in it, is not going to work. They have the format:
Just to be clear, the server is able to distinguish publish and subscribe messages from each other by looking at the message type (the 2nd header), which is 1 for publish message and 2 for subscribe messages.
Clients that have subscribed to channels, will get messages from the server whenever someone publishes a message on that same channel. These messages have the format: