非死book的 C++ HTTP 库:Proxygen
该项目包括</span> 非死book使用</span></span></span>的</span></span></span></span></span>核心</span> C++抽象HTTP。在内部,它被用作</span>构建HTTP服务器,代理服务器和客户端</span></span>的基础库。本次发布的重点是常见的HTTP抽象和简单的HttpServer框架。未来版本将提供简单的客户端API。该框架支持HTTP/1.1,SPDY/3,和SPDY/3.1。 HTTP /2支持正在进行中。我们的目标是提供一个简单,高性能,以及现代的C++ HTTP库。 目录结构和内容: 基础组件是
</span>
proxygen/external/
Contains non-installed 3rd-party code proxygen depends on.proxygen/lib/
Core networking abstractions.proxygen/lib/http/
HTTP specific code.proxygen/lib/services/
Connection management and server code.proxygen/lib/ssl/
TLS abstractions and OpenSSL wrappers.proxygen/lib/utils/
Miscellaneous helper code.proxygen/httpserver/
Contains code wrapping proxygen/lib/
for building simple C++ http servers. We recommend building on top of these APIs.架构
HTTPServer
, RequestHandlerFactory
, 和 RequestHandler。
An HTTPServer
takes some configuration and is given aRequestHandlerFactory
. Once the server is started, the installedRequestHandlerFactory
spawns a RequestHandler
for each HTTP request. RequestHandler
is a simple interface users of the library implement. Subclasses of RequestHandler
should use the inherited protected member ResponseHandler* downstream_
to send the response.