Hi,
phpwebsocket(websocket.class.php) is a HTML5 WebSocket server that enables user to directly connect to the socket from the browser. It is specially designed for the PHP server as the script is a PHP script and client can be any website with a browser. I was just having some research on it and got loads of error. Different errors I got are:
1) First I got the error as the client(My browser) could not connect to the server because of handshaking thing. And I sorted the reason that the newer version of Browser have only one Secret key sent to the server so, I removed two keys and only implemented 1 key. Then I got the key to $key. As from the wiki, the returning secret “Sec-WebSocket-Accept” was the sha1($key.”258EAFA5-E914-47DA-95CA-C5AB0DC85B11″) and base64 encode of it. Its a “.(dot)” not the “,(comma)”. And returned by writing to the socket as socket_write.
2) Next my brain couldn’t worked when the message received was just unwanted. And I searched all along and was messed up with some framing thing. I was lazy finding that. So, I just copied from some source for some kind of decryption thing.
3) Similarly, I did something for sending the message by the encryption thing. And I finally made the class work.
I will be happy to share my part of work and hope it will work on your system. You can copy and do anything with the code. You can research on each function changes that I have done.
Download the code from here