All Projects → daedric → Httpp

daedric / Httpp

Licence: bsd-2-clause
Micro http server and client written in C++

Programming Languages

cpp11
221 projects
cpp14
131 projects

Projects that are alternatives of or similar to Httpp

Libhv
🔥 比libevent、libuv更易用的国产网络库。A c/c++ network library for developing TCP/UDP/SSL/HTTP/WebSocket client/server.
Stars: ✭ 3,355 (+2229.86%)
Mutual labels:  http-client, https, http-server, curl
Kurly
kurly is an alternative to the widely popular curl program, written in Golang.
Stars: ✭ 319 (+121.53%)
Mutual labels:  http-client, curl, https
malloy
A C++ library providing embeddable server & client components for both HTTP and WebSocket.
Stars: ✭ 29 (-79.86%)
Mutual labels:  boost, http-client, http-server
Http Client
A high-performance, high-stability, cross-platform HTTP client.
Stars: ✭ 86 (-40.28%)
Mutual labels:  http-client, curl, https
Beast
HTTP and WebSocket built on Boost.Asio in C++11
Stars: ✭ 3,241 (+2150.69%)
Mutual labels:  boost, http-client, http-server
Jetty.project
Eclipse Jetty® - Web Container & Clients - supports HTTP/2, HTTP/1.1, HTTP/1.0, websocket, servlets, and more
Stars: ✭ 3,260 (+2163.89%)
Mutual labels:  http-client, https, http-server
Http
Event-driven, streaming HTTP client and server implementation for ReactPHP.
Stars: ✭ 507 (+252.08%)
Mutual labels:  http-client, https, http-server
Octane
A web server modeled after express in Rust.
Stars: ✭ 136 (-5.56%)
Mutual labels:  https, http-server
Okurl
OkHttp Kotlin command line
Stars: ✭ 77 (-46.53%)
Mutual labels:  curl, https
Aiohttp
Asynchronous HTTP client/server framework for asyncio and Python
Stars: ✭ 11,972 (+8213.89%)
Mutual labels:  http-client, http-server
Katipo
HTTP2 client for Erlang based on libcurl and libevent
Stars: ✭ 90 (-37.5%)
Mutual labels:  http-client, curl
Zio Tls Http
100% non-blocking, Java NIO only( inspired by zio-nio) , JSON HTTP server based on Scala ZIO library. Everything including TLS encryption modeled as ZIO effects, convenient route DSL similar to https4s, up to 30K TPS local JSON transaction with 25 threads on 6 cores(i7) with ZIO fibers.
Stars: ✭ 71 (-50.69%)
Mutual labels:  http-client, http-server
Akka Http
The Streaming-first HTTP server/module of Akka
Stars: ✭ 1,163 (+707.64%)
Mutual labels:  http-client, http-server
Esp Request
This project is no longer supported, please use
Stars: ✭ 65 (-54.86%)
Mutual labels:  http-client, https
Piaf
Client library for HTTP/1.X / HTTP/2 written entirely in OCaml.
Stars: ✭ 86 (-40.28%)
Mutual labels:  http-client, https
Cherrypy
CherryPy is a pythonic, object-oriented HTTP framework. https://docs.cherrypy.org/
Stars: ✭ 1,363 (+846.53%)
Mutual labels:  https, http-server
Merecat
Small and made-easy HTTP/HTTPS server based on Jef Poskanzer's thttpd
Stars: ✭ 69 (-52.08%)
Mutual labels:  https, http-server
Got
🌐 Human-friendly and powerful HTTP request library for Node.js
Stars: ✭ 10,620 (+7275%)
Mutual labels:  http-client, https
Qtnetworkng
QtNetwork Next Generation. A coroutine based network framework for Qt/C++, with more simpler API than boost::asio.
Stars: ✭ 125 (-13.19%)
Mutual labels:  http-client, http-server
Fenix
A simple and visual static web server with collaboration features.
Stars: ✭ 1,559 (+982.64%)
Mutual labels:  https, http-server

Build Status Coverity Status

httpp

Micro http server and client written in C++

The motivation behind this little piece of code is to provide a really simple, yet efficient HTTP server to implement in-app webservice easily.

The HttpServer will take care of the connections, request parsing and response generation. The handler on another hand is reponsible for implementing the "logic" behind the service. For example, the server has a very limited knowledge of the HTTP protocol…

The HttpClient has been implemented using curl and its multi interface.

See an exampe here or here.

REQUIREMENTS

Boost is required, version >= 1.54 and libcurl. HTTPP has a dependency on CommonPP since the version 0.7. CommonPP has a dependency on Boost and TBB. The TBB dependency will become optional.

A C++14 compliant compiler is also required.

BUILD

$> mkdir -p $HTTPP_PATH && cd $HTTPP_PATH
$> git clone https://github.com/daedric/httpp.git .
$> git submodule update --init
$> mkdir -p $HTTPP_BUILD_PATH && cd $HTTPP_BUILD_PATH
$> cmake $HTTPP_PATH
$> make

A debian package can be generated running:

$> make package

To build tests:

$> cmake $HTTPP_PATH -DBUILD_TESTS=ON

Examples:

$> cmake $HTTPP_PATH -DBUILD_EXAMPLES=ON

To build the shared library version:

$> cmake $HTTPP_PATH -DBUILD_SHARED_LIBS=ON

By default the build is in release mode, to change that you can:

$> cmake $HTTPP_PATH -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=DEBUG

The compilation and tests have been run on Mac OS X (curl and openssl from homebrew seems to be required to have all tests passing, I don't know why yet), and GNU/Linux distro (Ubuntu, ArchLinux).

Current stable

The current stable is the v0.7.0. There are still some things missing:

  • Optional commonpp dependencies;
  • Probes in the server.

Design choices

This section is only about the server.

Since the 0.7 version, HTTPP is trying to allocate as few memory as possible. Each connection is associated with some buffers that are never released to the system. This this might create a memory overhead, this allows to achieve a better performance.

The HTTP parser has been ported to Ragel to generate a faster parser than the one based on stream. I found out after having finished that Mongel did the same way before me, so I might try to import it if it makes sense.

At the same time, the parser avoids as much as possible copies by using boost::string_ref.

One of the reason is that HTTPP is designed to be used in a REST server exposing an API and developed for RTB platform, each request is relatively similar to the previous one in size. Second reason, it makes everything simpler (no buffer management, no release, no cache needed, etc).

Performances

This section is only about the server.

On a Dell 3800 with an Intel(R) Core(TM) i7-4702HQ CPU @ 2.20GHz, I was able to achieve between 160K and 180K request per second with the ping program (against 70 to 90K with the 0.6.2) and ab with -k -c 8 options on the same machine, this means that HTTPP overhead is about 5 to 6 micro seconds.

With a slightly more complex server that decoded the request, performed some string manipulation and returned a predefined json payload, we have seen approximately 220K requests per second on identical hardware, using wrk to drive the load testing. 5 threads were allocated to the httpp server, and 3 to wrk (with 500 concurrent connections).

This is scaling as threads are added but I don't have enough proper machine to do a real benchmark.

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].