All Projects → fastdlabs → http

fastdlabs / http

Licence: MIT license
Support Swoole Implement PSR7

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to http

Laravel Swoole
High performance HTTP server based on Swoole. Speed up your Laravel or Lumen applications.
Stars: ✭ 3,726 (+13207.14%)
Mutual labels:  swoole, swoole-http
swoole
FastD Swoole 基础组件
Stars: ✭ 76 (+171.43%)
Mutual labels:  swoole, swoole-http
Phpdhtspider
php实现的dht爬虫
Stars: ✭ 248 (+785.71%)
Mutual labels:  swoole
swoole api framework
swoole
Stars: ✭ 28 (+0%)
Mutual labels:  swoole
fast-laravel
基于Swoole的高性能HTTP服务器,加速您Laravel应用程序。
Stars: ✭ 33 (+17.86%)
Mutual labels:  swoole
dwoole
⚙️ Docker image for Swoole apps with Composer, auto-restart on development and a production-ready version.
Stars: ✭ 32 (+14.29%)
Mutual labels:  swoole
yii2-s
🚀speed up yii2 tcp server、 restful by swoole
Stars: ✭ 34 (+21.43%)
Mutual labels:  swoole
Hyperf Admin
hyperf-admin 是基于 hyperf + vue 的配置化后台开发工具
Stars: ✭ 244 (+771.43%)
Mutual labels:  swoole
orange
基于beanstalkd实现多进程处理消息队列的框架
Stars: ✭ 19 (-32.14%)
Mutual labels:  swoole
swoole-link-monitor
基于swoole 定时器与woker 实现链路监控
Stars: ✭ 34 (+21.43%)
Mutual labels:  swoole
create-siler-app
🧱 Set up a modern Siler app by running one command.
Stars: ✭ 15 (-46.43%)
Mutual labels:  swoole
crow
Fast, unopinionated, minimalist web framework for PHP.
Stars: ✭ 47 (+67.86%)
Mutual labels:  swoole
docker-images
本仓库为自定义及收藏的一些镜像,方便使用。包含PHP5、PHP7开发环境等镜像。
Stars: ✭ 18 (-35.71%)
Mutual labels:  swoole
TT Jobs
基于 Swoole 定时管理系统
Stars: ✭ 22 (-21.43%)
Mutual labels:  swoole
docker-swoole-webapp
Simple Docker-image to build your applications based on Async PHP extensions.
Stars: ✭ 26 (-7.14%)
Mutual labels:  swoole
swoole-cs.github.io
swoole 4.x cheat sheet
Stars: ✭ 21 (-25%)
Mutual labels:  swoole
W7 Rangine Empty
软擎是基于 Php 7.2+ 和 Swoole 4.4+ 的高性能、简单易用的开发框架。支持同时在 Swoole Server 和 php-fpm 两种模式下运行。内置了 Http (Swoole, Fpm),Tcp,WebSocket,Process,Crontab服务。集成了大量成熟的组件,可以用于构建高性能的Web系统、API、中间件、基础服务等等。
Stars: ✭ 246 (+778.57%)
Mutual labels:  swoole
LightMoon
A framework based swoole
Stars: ✭ 17 (-39.29%)
Mutual labels:  swoole
HyperVue
🚀 基于 Hyperf + Vue + ElementUI 前后端分离的通用型管理后台
Stars: ✭ 23 (-17.86%)
Mutual labels:  swoole
http-emitter
📡 Emitting psr-7 responses.
Stars: ✭ 31 (+10.71%)
Mutual labels:  swoole

FastD HTTP Server and Client

Build Status Support Swoole Support PSR7 Latest Stable Version Total Downloads Latest Unstable Version License

简单的 Http 协议组件, 用于解析 Http 请求信息, 实现 PSR-7 标准, 支持 Swoole 扩展.

以上库可以满足大部分 HTTP 请求处理相关工作, 支持 Swoole 处理, 具体请看项目Swoole

要求

  • php >= 5.6

安装

composer require "fastd/http" -vvv

文档

文档

使用

HTTP 组件封装了常用的服务端解释,客户端请求,并且友好集成 Swoole Http Server 解析,实现PSR-7。

HTTP 组件没有对 Session 进行封装, 如果想在项目中支持 Session, 可以通过 Session 组件进行扩展.

获取 pathinfo
use FastD\Http\ServerRequest;

$request = ServerRequest::createServerRequestFromGlobals();

$request->getUri()->getPath();
Swoole Http 服务器
$http = new swoole_http_server("127.0.0.1", 9501);

$http->on('request', function ($request, $response) {
    $server = SwooleServerRequest::createServerRequestFromSwoole($request);
    $response->end($server->getUri()->getPath());
});

$http->start();
cURL 请求

Request 对象内部封装了 cURL 请求, 可以直接通过方法调用

$request = new Request('GET', 'https://api.github.com/');

$request->setReferrer('http://example.com/');

$response = $request->send(); // FastD\Http\Response

响应内容会通过 Response 对象返回。

贡献

非常欢迎感兴趣,愿意参与其中,共同打造更好PHP生态,Swoole生态的开发者。

如果你乐于此,却又不知如何开始,可以试试下面这些事情:

联系

如果你在使用中遇到问题,请联系: [email protected]. 微博: 编码侠

License MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].