Can validators be used with Websockets?

I want to validate the message text before sending it. I know it can be done using the validator inside the Ws Controller, I want to know if I can create a Validation .js file as http Controller and use it with websocket.

B/R.

Didn’t really get what you are looking for. Do you mean you want to use Route validators with Websockets?

Hi @virk
Yes. I’m developing a message system and messages are stored in a database. For security I’d like the messages to be validated before storing them.

Not directly. I suggest doing the inline validation by importing the validate method