Engagement
Start in shell WebSocket server: php -q websockets.php
.
Start in shell WebSocket client: php -S 127.0.00.1:8000 websockets.html
please use separated tab in terminal.
Test
Open in browser URL: http://0.0.0.0:8000/
you will see current timestamp which will continuously updating! Hence, it works!
Conclusion This is just super simple PHP WebSocket example. Yes, it isn’t real world example, but it is as simple as possible sample