While the socket.io message system needs to be able to send any events that the EDSDK might have as messages, a connected client should only receive messages it has explicitly opted in to. This can be achieved by having 'subscription' routes as part of the normal REST API.
Thoughts on implementation:
Socket.io already has a mechanism for grouping clients and servers into rooms that we can use to implement this.
There should be a route for subscribing to a message of some type and a route for unsubscribing
One subscription route with a path parameter for the message type should suffice (and a similar unsubscribe route)
While the socket.io message system needs to be able to send any events that the EDSDK might have as messages, a connected client should only receive messages it has explicitly opted in to. This can be achieved by having 'subscription' routes as part of the normal REST API.
Thoughts on implementation: