作者 lyh

gx

@@ -33,7 +33,7 @@ Websocket::on('message', function ($websocket, $data) { @@ -33,7 +33,7 @@ Websocket::on('message', function ($websocket, $data) {
33 33
34 // 假设 $data 是客户端发送过来的数据 34 // 假设 $data 是客户端发送过来的数据
35 // 在这里您可以根据接收到的消息进行处理 35 // 在这里您可以根据接收到的消息进行处理
36 - 36 + @file_put_contents(storage_path('logs/lyh_error.log'), var_export($data, true) . PHP_EOL, FILE_APPEND);
37 // 回复消息给客户端 37 // 回复消息给客户端
38 $websocket->send("Hello, Client! You sent: $data"); 38 $websocket->send("Hello, Client! You sent: $data");
39 }); 39 });