“慢生活”不是懒惰,放慢速度不是拖延时间,而是让我们在生活中寻找到平衡。网站首页程序人生
workerman的http服务-session会话-获取session对象
发布时间:2021-12-08 00:31:00作者:雪饮
![[!--pagekey--]](/e/data/images/notimg.gif)
说明workerman从4.x版本开始加强了HTTP服务的支持。引入了请求类、响应类、session类以及SSE。如果你想使用workerman的HTTP服务,强烈推荐使用workerman4.x或者以后的更高版
阅读全文>>workerman的http服务-响应 - 发送http chunk数据(有点懒加载的效果)
发布时间:2021-12-06 23:43:22作者:雪饮
![[!--pagekey--]](/d/file/manshenghuo/chengxurensheng/0ba7472ff0ca0b66dded37334f17243a.png)
发送http chunk数据必须先发送一个携带 Transfer-Encoding: chunked头的Response响应给客户端发送后续chunk数据使用Workerman\Protocols\Http\Chunk 类最终必须发送一个空
阅读全文>>workerman的http服务-响应-重定向
发布时间:2021-12-06 23:36:18作者:雪饮
![[!--pagekey--]](/e/data/images/notimg.gif)
重定向实例:<?phpuse Workerman\Worker;use Workerman\Protocols\Http\Request;use Workerman\Protocols\Http\Response;require_once __DIR__ . '/vendor/autoload.php'; $
阅读全文>>workerman的http服务-响应-重定向 - 发送文件(实现文件下载服务)
发布时间:2021-12-06 23:35:26作者:雪饮
![[!--pagekey--]](/e/data/images/notimg.gif)
同样的,发送文件需要使用Workerman\Protocols\Http\Response响应类。 发送文件时用以下方式 $response = (new Response())->withFile($file);$connection->send($response)
阅读全文>>workerman的http服务-响应-重定向 - 发送cookie
发布时间:2021-12-06 23:33:42作者:雪饮
![[!--pagekey--]](/e/data/images/notimg.gif)
workerman的http服务-响应-重定向 - 发送cookie
阅读全文>>