In this tutorial, we will create a script that runs in a Linux/Mac/Windows terminal and acts as a WebSocket client to connect to any WebSocket server, Using textalk/websocket library.
There is a tutorial for this repository published on PieSocket: Building a PHP WebSocket Client
git clone [email protected]:piesocket/php-websocket-client-example.gitcd php-websocket-client-examplecomposer install
- Change the demo WebSocket Server from PieSocket to your own
- Run
php client.php