back to home

nghttp2 / nghttp2

nghttp2 - HTTP/2 C Library and tools

4,966 stars
933 forks
46 issues
C++CGo

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing nghttp2/nghttp2 in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Source files are only loaded when you start an analysis to optimize performance.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind.in/repo/nghttp2/nghttp2)
Preview:Analyzed by RepoMind

Repository Overview (README excerpt)

Crawler view

nghttp2 - HTTP/2 C Library ========================== This is an implementation of the Hypertext Transfer Protocol version 2 in C. The framing layer of HTTP/2 is implemented as a reusable C library. On top of that, we have implemented an HTTP/2 client, server and proxy. We have also developed load test and benchmarking tools for HTTP/2. An HPACK encoder and decoder are available as a public API. Development Status ------------------ nghttp2 was originally developed based on _ HTTP/2 and _ HPACK - Header Compression for HTTP/2. Now we are updating our code to implement _. The nghttp2 code base was forked from the spdylay (https://github.com/tatsuhiro-t/spdylay) project. Public Test Server ------------------ The following endpoints are available to try out our nghttp2 implementation. • https://nghttp2.org/ (TLS + ALPN and HTTP/3) This endpoint supports h2 and http/1.1 via ALPN and requires TLSv1.2 for HTTP/2 connection. It also supports HTTP/3. • http://nghttp2.org/ (HTTP Upgrade and HTTP/2 Direct) h2c and http/1.1 . Requirements ------------ The following package is required to build the libnghttp2 library: • pkg-config >= 0.20 To build the documentation, you need to install: • sphinx (http://sphinx-doc.org/) If you need libnghttp2 (C library) only, then the above packages are all you need. Use --enable-lib-only to ensure that only libnghttp2 is built. This avoids potential build error related to building bundled applications. To build and run the application programs ( nghttp , nghttpd , nghttpx and h2load ) in the src directory, the following packages are required: • OpenSSL >= 1.1.1; or wolfSSL >= 5.7.0; or LibreSSL >= 3.8.1; or aws-lc >= 1.19.0; or BoringSSL • libev >= 4.11 • zlib >= 1.2.3 • libc-ares >= 1.7.5 To enable -a option (getting linked assets from the downloaded resource) in nghttp , the following package is required: • libxml2 >= 2.6.26 To enable systemd support in nghttpx, the following package is required: • libsystemd-dev >= 209 The HPACK tools require the following package: • jansson >= 2.5 To build sources under the examples directory, libevent is required: • libevent-openssl >= 2.0.8 To mitigate heap fragmentation in long running server programs ( nghttpd and nghttpx ), jemalloc is recommended: • jemalloc .. note:: Alpine Linux currently does not support malloc replacement due to musl limitations. See details in issue _. For BoringSSL or aws-lc build, to enable :rfc: TLS Certificate Compression in applications, the following library is required: • libbrotli-dev >= 1.0.9 To enable mruby support for nghttpx, _ is required. We need to build mruby with C++ ABI explicitly turned on, and probably need other mrgems, mruby is managed by git submodule under third-party/mruby directory. Currently, mruby support for nghttpx is disabled by default. To enable mruby support, use --with-mruby configure option. Note that at the time of this writing, libmruby-dev and mruby packages in Debian/Ubuntu are not usable for nghttp2, since they do not enable C++ ABI. To build mruby, the following packages are required: • ruby • bison nghttpx supports _, privilege separation engine for OpenSSL. In short, it minimizes the risk of private key leakage when serious bug like Heartbleed is exploited. The neverbleed is disabled by default. To enable it, use --with-neverbleed configure option. To enable the experimental HTTP/3 support for h2load and nghttpx, the following libraries are required: • _; or wolfSSL; or LibreSSL (does not support 0RTT); or aws-lc; or _ (commit 52975ff6ea9fb076e53025b82f2e80a23b027a5c); or OpenSSL >= 3.5.0 • _ >= 1.16.0 • _ >= 1.12.0 Use --enable-http3 configure option to enable HTTP/3 feature for h2load and nghttpx. In order to build optional eBPF program to direct an incoming QUIC UDP datagram to a correct socket for nghttpx, the following libraries are required: • libbpf-dev >= 0.7.0 Use --with-libbpf configure option to build eBPF program. libelf-dev is needed to build libbpf. For Ubuntu 20.04, you can build libbpf from _. nghttpx requires eBPF program for reloading its configuration and hot swapping its executable. Compiling libnghttp2 C source code requires a C99 compiler. gcc 4.8 is known to be adequate. In order to compile the C++ source code, C++20 compliant compiler is required. At least g++ >= 12 and clang++ >= 18 are known to work. .. note:: To enable mruby support in nghttpx, and use --with-mruby configure option. .. note:: Mac OS X users may need the --disable-threads configure option to disable multi-threading in nghttpd, nghttpx and h2load to prevent them from crashing. A patch is welcome to make multi threading work on Mac OS X platform. .. note:: To compile the associated applications (nghttp, nghttpd, nghttpx and h2load), you must use the --enable-app configure option and ensure that the specified requirements above are met. Normally, configure script checks required dependencies to build these applications, and enable --enable-app automatically, so you don't have to use it explicitly. But if you found that applications were not built, then using --enable-app may find that cause, such as the missing dependency. .. note:: In order to detect third party libraries, pkg-config is used (however we don't use pkg-config for some libraries (e.g., libev)). By default, pkg-config searches *.pc file in the standard locations (e.g., /usr/lib/pkgconfig). If it is necessary to use *.pc file in the custom location, specify paths to PKG_CONFIG_PATH environment variable, and pass it to configure script, like so: .. code-block:: text $ ./configure PKG_CONFIG_PATH=/path/to/pkgconfig For pkg-config managed libraries, *_CFLAG and *_LIBS environment variables are defined (e.g., OPENSSL_CFLAGS , OPENSSL_LIBS ). Specifying non-empty string to these variables completely overrides pkg-config. In other words, if they are specified, pkg-config is not used for detection, and user is responsible to sp…