You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-2Lines changed: 24 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,9 @@
2
2
A server side alternative implementation of [socket.io](https://github.com/socketio/socket.io) in PHP based on [Workerman](https://github.com/walkor/Workerman).<br>
3
3
4
4
# Notice
5
-
Only support socket.io v1.3.0 or greater. <br>
5
+
Only support socket.io >= v1.3.0 and <= v2.x <br>
6
6
This project is just translate socket.io by [workerman](https://github.com/walkor/Workerman).<br>
7
-
More api just see http://socket.io/docs/server-api/
7
+
More api just see [https://socket.io/docs/v2/server-api/](https://socket.io/docs/v2/server-api/)
8
8
9
9
# Install
10
10
composer require workerman/phpsocket.io
@@ -138,6 +138,28 @@ $io->on('connection', function ($connection) use ($io) {
138
138
Worker::runAll();
139
139
```
140
140
141
+
## Acknowledgement callback
142
+
```php
143
+
144
+
use Workerman\Worker;
145
+
use PHPSocketIO\SocketIO;
146
+
147
+
require_once __DIR__ . '/vendor/autoload.php';
148
+
149
+
$io = new SocketIO(2021);
150
+
151
+
$io->on('connection', function ($connection) use ($io) {
152
+
$socket->on('message with ack', function ($data, $callback) use ($socket, $io) {
0 commit comments