I do web sockets for php with workerman .. It runs on the server successfully, but I can not listen. Uncaught ReferenceError: Websocket is not defined

<!DOCTYPE html> <html> <head> <title></title> </head> <body> <script type="text/javascript"> let ws=new Websocket('ws://0.0.0.0:1234'); ws.addEventListener('message',(event) =>{ console.log('message from server '+ event.data); }); </script> </body> </html> 

I used to appear in php index.php connections when switching to the direct http: // adress: 1234 , but now I write an error

 400 Bad Request Sec-WebSocket-Key not found. This is a WebSocket service and can not be accessed via HTTP. 

    1 answer 1

    Decided to figure it out

     let ws=new Websocket('ws://0.0.0.0:1234'); 

    Replaced by

     let ws=new WebSocket('ws://*айпи впс*:1234');