How do I set MessageType using wsProvider?

The messageHandlers function is provided by Provider, but how is it used?

I would like to receive Messages on the server side and handle authorization and handling of data sent by the client.