# echo-test **Repository Path**: aniual/echo-test ## Basic Information - **Project Name**: echo-test - **Description**: No description available - **Primary Language**: PHP - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-06-07 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### Laravel5.8 + Swoole + websocket **安装swoole 扩展** - 1、本人使用的是Mac MAMP工具进行启动。 在php.ini文件里面添加如下: `extension = swoole.so` 2、swoole websocket的文件在socket文件夹下面,仅仅为了测试使用,写了好几种方法。测试以及测压。框架其他的地方为空。 启动方式例如 php server.php 即可启动一个websocket 服务 在启动一个php -S localhost:8000/index.html。一个客户端和服务端启动 3、测试没问题了以后在命令行进行 `php artisan make:command Swoole`创建一个Swoole启动类 ``` 启动方式为: php artisan swoole start 即可启动 ``` 4、大家后续可以将变量写入.env配置文件中 ``` SWOOLE_HOST=127.0.0.1 SWOOLE_PORT=9502 ``` **暂时写了个简单的websocket服务,如有问题可以留言**