An example WebSocket chat server written in PHP (using websocketd) with bi-directional communication between the client and server.
- Clone the repo
phpsocket
into your web root - Ensure the web server can read/write to the file
phpsocket/server/data.txt
- Download websocketd and unzip the binary
websocketd
tophpsocket/bin
The provided shell script phpsocket/start.sh
will start the WebSocket server on port 8080. (The port can be changed by editing start.sh)
Once the WebSocket server is running, open your browser to http://localhost/phpsocket/
CTRL+c will stop the server
##Troubleshooting
websocketd will output any errors in server.php to the terminal.
MIT