The way the web socket server part works is there are requests (outgoing messages) and data handlers (for incoming messages)
When a message is received than the message type gets checked against a list of known message types and if it matches it is passed off to the handler for that type.
So to extend functionality you make a plugin that adds requests and handlers for the message types you want to use.