Skip to content
Branch: master
Go to file

Latest commit


Failed to load latest commit information.
Latest commit message
Commit time

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.

How to setup it

1) You will need a wsphp 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.


Simple and fast chat written with PHP using Websockets.



No releases published
You can’t perform that action at this time.