ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
~~~ require_once 'workerman/Autoloader.php'; use Workerman\Worker; $ws= new Worker('websocket://0.0.0.0:2222'); $ws->onMessage=function ($connection,$data){ $connection->send('hello websocket---'.$data); }; Worker::runAll(); ~~~ ## 启动就可以 ``` php websocket.php start ``` ![](https://img.kancloud.cn/e2/01/e2014f49011ad4101b407d0dc254865f_1653x716.png)