0
I’m testing WebSocket
turning at the door 80
, I’ve already disabled the SSL, but I’m not getting results...
javascript
var ws = new WebSocket('ws://localhost:80/socket2.php');
An example I have seen, tested and successfully returns was using wss://echo.websocket.org
. So I guess the mistake is around here somewhere.
The return of the browser is always the same:
Firefox was unable to establish a connection to the Ws:/localhost/socket2.php server
The headers as in the example:
socket2.php
header("HTTP/1.1 101 Switching Protocols");
header("Upgrade: websocket");
header("Connection: Upgrade");
header("Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=");
On the console the Websocket request returns 101 / websocket / 0B
NOTE: Use Apache, everything is as before.