I'm testing WebSocket
running on port 80
, I've disabled SSL , but I'm not getting results ...
javascript
var ws = new WebSocket('ws://localhost:80/socket2.php');
One example I saw, tested, and returned successfully was using wss://echo.websocket.org
. So I guess the error is right here.
The return of the browser is always the same:
Firefox was unable to establish a connection to the server ws: //localhost/socket2.php
Headers as in example :
socket2.php
header("HTTP/1.1 101 Switching Protocols");
header("Upgrade: websocket");
header("Connection: Upgrade");
header("Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=");
In the console the WebSocket request returns 101 / websocket / 0B
Apache , it's all as before.