Is it a good idea to use websocket on webviewer

try to understand what i am saying is

instead of using extension for websocket is it good idea to listen websocket messages from a php script

like we can make a php script which will alert all messages and we can use custom web viewer to get alert messages

will it cause any problem in future , anyone had try this ?