I have a server in PHP which binds to a port and listens to sockets. My server is started in a PHP script with:
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_set_option($socket, SOL_SOCKET, SO_REUSEADDR, 1);
socket_bind($socket, 0, $port);
It then listens to the port:
socket_listen($socket);
When a HTTP message arrives from the client, the server reads the header:
$header = socket_read($socket_new,1024);
and then stores the connection in a Memcache storage. This works for most browsers including safari, firefox and Chrome's Canary. However, it doesn't work on chrome. The browser throws an error message:
WebSocket connection to 'ws://xyz.com:9001/chat_server.php' failed: Error during WebSocket handshake: Incorrect 'Sec-WebSocket-Accept' header value
My version of Chrome is: Version 38.0.2125.111 m (64-bit)