Skip to content

Commit

Permalink
Add client-side code
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Oct 5, 2024
1 parent 4ea9432 commit 7565e5f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,19 @@ Serving Imitator(dev)[] > websocket.logging.ToConsole
# ...
```
To connect to this server, use the following:
```php
use util\cmd\Console;
use websocket\WebSocket;

$s= new WebSocket('ws://localhost:8081/echo';
$s->connect();

$s->send('Hello');
Console::writeLine('<<< ', $s->receive());
```
On the JavaScript side, open the connection as follows:
```javascript
Expand Down

0 comments on commit 7565e5f

Please sign in to comment.