PHP and WebSockets chat
This is simple HTML chat with the following features:1) Unlimited number of connections (users).
2) Every user may select his/her nickname and color.
3) There are notifications wher someone has joined or left the chat.
4) Minumum use of PHP.
1) You will need a How to setup itwsphp server installed.
2) Setup app_path config option to point to app.php
3) Disable cron_path config option as we do not use it.
Network communications are done using Websockets. WebSocket is a computer communications protocol, providing full-duplex communication channels over a single TCP connection. That is why we can read (via ws.onmessage callback) and send messages (via ws.send) using only one websocket connection. WSPHP server takes care about websocket protocol actions: handshake, encoding/decoding frames, etc. PHP role is small - it just re-sends received message to all connected users. Messages are wrapped to JSON format for convenience.