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.