Help with yii2 and websockets

I need to add functionality to a yii2 application to connect to a MySQL database using websockets and retrieve some statistical information. I can’t find any information about how to do this. Please, anyone that can point me in the right direction ? Perhaps show me some examples of using websockets with yii. I need to get this done so any help will be appreciated.

Yunior, it`s not a yii question.

Check this