🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# 代码案例 ~~~ <?php require_once 'workerman/Autoloader.php'; use Workerman\Worker; $worker=new Worker('text://0.0.0.0:8883'); $worker->onConnect = function($connection) { echo "new connection from address ". $connection->getRemoteIp() . ":". $connection->getRemotePort() ."\n"; //获取端口与IP }; Worker::runAll(); ~~~ ![](https://img.kancloud.cn/77/ab/77abb12536cd45f7eaad286c54b6c745_1341x280.png)