Downloads
Stars
Version
使用swoole加速laravel ,原有的项目代码无需变动! 原有的项目代码无需变动! 原有的项目代码无需变动!!!
prefix=/data/wwwroot/laravelTest #项目安装目录
php_bin=/data/install/php/bin/php #php执行文件位置
app_entry=${prefix}/api/api.php #入口脚本位置
app_pid_file=/var/run/swoole.pid #pid文件
#配置文件
config/server.php
'bind_addr' => '0.0.0.0', //绑定地址
'port' => 82, //绑定端口
'debug_ip' => ['192.168.30.1', '127.0.0.1'],//限制日志输出的服务器
'swoole' => [] //服务器配置参数
#webscoket 请求协议详细参考 wsClient代码
$frame = '{"header":{},"get":{"username":"gw123","password":123456},"post":{},"body":"value"}';
$frame = '{"header":{"path_info":"/test"},"get":{"username":"gw123","password":123456},"post":{},"body":"value"}';
$frame = '{"header":{"path_info":"/gogo"},"get":{"username":"gw123","password":123456},"post":{},"body":"value"}';
header 同http协议中的 header ,唯一不同的是需要指定 path_info 等同get的请求路径.
所以协议默认请求下是模拟get请求 提交方式为 application/www-url-decode
get 可以指定get参数
post 指定post参数 需要配置header 设置REQUEST_METHOD为 POST
body 是原始请求体用来实现一些特殊的请求(完善中)