C++封装的基于libevent的HTTP 服务器(含源码)

本文介绍了多种 C++ HTTP 服务器框架及库,包括 ACE、Boost.Asio、C++REST SDK 等,并探讨了使用 libevent 自带的 HTTP server 功能进行封装的可能性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

原文地址:
https://blog.csdn.net/atp1992/article/details/99708245?spm=1001.2101.3001.6650.1&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1.no_search_link

本想找个好用方便简单高效的c++ http服务器框架,看来看去也没看到有非常合适的,后面也就懒得纠结了,用libevent自带的http server功能吧,不过看了看接口,c语言的接口用起来还是不太方便,如果用户是用c++,还要管理大量的c层面的指针,buffer,结构体等,于是就想着封装成c++形式的,而且利用c++11以后的一些特性,可以完全屏蔽c的这些细节。

如下c++ http框架、库摘自awesome-cpp: https://github.com/fffaraz/awesome-cpp#regular-expression

ACE - An OO Network Programming Toolkit in C++. [?MIT?]
Boost.Asio - A cross-platform C++ library for network and low-level I/O programming. [Boost]
C++ REST SDK - C++ REST SDK (previously named Casablanca). [Apache2]
Restbed - C++11 Asynchronous RESTful framework. [AGPL]
Proxygen - Facebook’s collection of C++ HTTP libraries including an easy to use HTTP server. [BSD]
Muduo - A C++ non-blocking network library for multi-threaded server in Linux. [BSD]
cpr - A modern C++ HTTP requests library with a simple but powerful interface. Modeled after the Python Requests module. [MIT] website
Mongoose - Extremely lightweight webserver. [GPL2]
libcurl - Multiprotocol file transfer library. [MIT/X derivate license]
curlcpp - An object oriented C++ wrapper for CURL(libcurl). [MIT]
Boost.Beast - HTTP and WebSocket built on Boost.Asio in C++11. [BSL-1.0] website
Breep - Event based, high-level C++14 peer-to-peer library. [EUPL-1.1 (OSI approved)]
libhttpserver - C++ library for creating an embedded Rest HTTP server (and more). [LGPL2.1]
uWebSockets - µWS is one of the most lightweight, efficient & scalable WebSocket & HTTP server implementations available. [Zlib]
restclient-cpp - Simple REST client for C++. It wraps libcurl for HTTP requests. [MIT]
Seasocks - Simple, small, C++ embeddable webserver with WebSockets support. [BSD]
Silicon - A high performance, middleware oriented C++14 http web framework. [MIT]
nghttp2 - HTTP/2 C Library. [MIT] website
Onion - HTTP server library in C designed to be lightweight and easy to use. [Apache2/GPL2]
PicoHTTPParser - A tiny, primitive, fast HTTP request/response parser. [MIT]
evpp - C++ high performance networking with TCP/UDP/HTTP protocols. [BSD]
H2O - An optimized HTTP server with support for HTTP/1.x and HTTP/2. It can also be used as a library. [MIT]
HTTP Parser - A http request/response parser for C. [MIT]
Restinio - A header-only C++14 library that gives you an embedded HTTP/Websocket server. [BSD]
cpp-httplib - A single file C++11 header-only HTTP/HTTPS sever library. [MIT]
cpp-netlib - A collection of open-source libraries for high level network programming. [Boost]

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值