12c593315Sopenharmony_cinghttp2 - HTTP/2 C Library
22c593315Sopenharmony_ci==========================
32c593315Sopenharmony_ci
42c593315Sopenharmony_ciThis is an implementation of the Hypertext Transfer Protocol version 2
52c593315Sopenharmony_ciin C.
62c593315Sopenharmony_ci
72c593315Sopenharmony_ciThe framing layer of HTTP/2 is implemented as a reusable C library.
82c593315Sopenharmony_ciOn top of that, we have implemented an HTTP/2 client, server and
92c593315Sopenharmony_ciproxy.  We have also developed load test and benchmarking tools for
102c593315Sopenharmony_ciHTTP/2.
112c593315Sopenharmony_ci
122c593315Sopenharmony_ciAn HPACK encoder and decoder are available as a public API.
132c593315Sopenharmony_ci
142c593315Sopenharmony_ciDevelopment Status
152c593315Sopenharmony_ci------------------
162c593315Sopenharmony_ci
172c593315Sopenharmony_cinghttp2 was originally developed based on `RFC 7540
182c593315Sopenharmony_ci<https://tools.ietf.org/html/rfc7540>`_ HTTP/2 and `RFC 7541
192c593315Sopenharmony_ci<https://tools.ietf.org/html/rfc7541>`_ HPACK - Header Compression for
202c593315Sopenharmony_ciHTTP/2.  Now we are updating our code to implement `RFC 9113
212c593315Sopenharmony_ci<https://datatracker.ietf.org/doc/html/rfc9113>`_.
222c593315Sopenharmony_ci
232c593315Sopenharmony_ciThe nghttp2 code base was forked from the spdylay
242c593315Sopenharmony_ci(https://github.com/tatsuhiro-t/spdylay) project.
252c593315Sopenharmony_ci
262c593315Sopenharmony_ciPublic Test Server
272c593315Sopenharmony_ci------------------
282c593315Sopenharmony_ci
292c593315Sopenharmony_ciThe following endpoints are available to try out our nghttp2
302c593315Sopenharmony_ciimplementation.
312c593315Sopenharmony_ci
322c593315Sopenharmony_ci* https://nghttp2.org/ (TLS + ALPN/NPN and HTTP/3)
332c593315Sopenharmony_ci
342c593315Sopenharmony_ci  This endpoint supports ``h2``, ``h2-16``, ``h2-14``, and
352c593315Sopenharmony_ci  ``http/1.1`` via ALPN/NPN and requires TLSv1.2 for HTTP/2
362c593315Sopenharmony_ci  connection.
372c593315Sopenharmony_ci
382c593315Sopenharmony_ci  It also supports HTTP/3.
392c593315Sopenharmony_ci
402c593315Sopenharmony_ci* http://nghttp2.org/ (HTTP Upgrade and HTTP/2 Direct)
412c593315Sopenharmony_ci
422c593315Sopenharmony_ci  ``h2c`` and ``http/1.1``.
432c593315Sopenharmony_ci
442c593315Sopenharmony_ciRequirements
452c593315Sopenharmony_ci------------
462c593315Sopenharmony_ci
472c593315Sopenharmony_ciThe following package is required to build the libnghttp2 library:
482c593315Sopenharmony_ci
492c593315Sopenharmony_ci* pkg-config >= 0.20
502c593315Sopenharmony_ci
512c593315Sopenharmony_ciTo build and run the unit test programs, the following package is
522c593315Sopenharmony_cirequired:
532c593315Sopenharmony_ci
542c593315Sopenharmony_ci* cunit >= 2.1
552c593315Sopenharmony_ci
562c593315Sopenharmony_ciTo build the documentation, you need to install:
572c593315Sopenharmony_ci
582c593315Sopenharmony_ci* sphinx (http://sphinx-doc.org/)
592c593315Sopenharmony_ci
602c593315Sopenharmony_ciIf you need libnghttp2 (C library) only, then the above packages are
612c593315Sopenharmony_ciall you need.  Use ``--enable-lib-only`` to ensure that only
622c593315Sopenharmony_cilibnghttp2 is built.  This avoids potential build error related to
632c593315Sopenharmony_cibuilding bundled applications.
642c593315Sopenharmony_ci
652c593315Sopenharmony_ciTo build and run the application programs (``nghttp``, ``nghttpd``,
662c593315Sopenharmony_ci``nghttpx`` and ``h2load``) in the ``src`` directory, the following packages
672c593315Sopenharmony_ciare required:
682c593315Sopenharmony_ci
692c593315Sopenharmony_ci* OpenSSL >= 1.0.1
702c593315Sopenharmony_ci* libev >= 4.11
712c593315Sopenharmony_ci* zlib >= 1.2.3
722c593315Sopenharmony_ci* libc-ares >= 1.7.5
732c593315Sopenharmony_ci
742c593315Sopenharmony_ciALPN support requires OpenSSL >= 1.0.2 (released 22 January 2015).
752c593315Sopenharmony_ciLibreSSL >= 2.2.0 can be used instead of OpenSSL, but OpenSSL has more
762c593315Sopenharmony_cifeatures than LibreSSL at the time of this writing.
772c593315Sopenharmony_ci
782c593315Sopenharmony_ciTo enable ``-a`` option (getting linked assets from the downloaded
792c593315Sopenharmony_ciresource) in ``nghttp``, the following package is required:
802c593315Sopenharmony_ci
812c593315Sopenharmony_ci* libxml2 >= 2.6.26
822c593315Sopenharmony_ci
832c593315Sopenharmony_ciTo enable systemd support in nghttpx, the following package is
842c593315Sopenharmony_cirequired:
852c593315Sopenharmony_ci
862c593315Sopenharmony_ci* libsystemd-dev >= 209
872c593315Sopenharmony_ci
882c593315Sopenharmony_ciThe HPACK tools require the following package:
892c593315Sopenharmony_ci
902c593315Sopenharmony_ci* jansson >= 2.5
912c593315Sopenharmony_ci
922c593315Sopenharmony_ciTo build sources under the examples directory, libevent is required:
932c593315Sopenharmony_ci
942c593315Sopenharmony_ci* libevent-openssl >= 2.0.8
952c593315Sopenharmony_ci
962c593315Sopenharmony_ciTo mitigate heap fragmentation in long running server programs
972c593315Sopenharmony_ci(``nghttpd`` and ``nghttpx``), jemalloc is recommended:
982c593315Sopenharmony_ci
992c593315Sopenharmony_ci* jemalloc
1002c593315Sopenharmony_ci
1012c593315Sopenharmony_ci  .. note::
1022c593315Sopenharmony_ci
1032c593315Sopenharmony_ci     Alpine Linux currently does not support malloc replacement
1042c593315Sopenharmony_ci     due to musl limitations. See details in issue `#762 <https://github.com/nghttp2/nghttp2/issues/762>`_.
1052c593315Sopenharmony_ci
1062c593315Sopenharmony_ciTo enable mruby support for nghttpx, `mruby
1072c593315Sopenharmony_ci<https://github.com/mruby/mruby>`_ is required.  We need to build
1082c593315Sopenharmony_cimruby with C++ ABI explicitly turned on, and probably need other
1092c593315Sopenharmony_cimrgems, mruby is manged by git submodule under third-party/mruby
1102c593315Sopenharmony_cidirectory.  Currently, mruby support for nghttpx is disabled by
1112c593315Sopenharmony_cidefault.  To enable mruby support, use ``--with-mruby`` configure
1122c593315Sopenharmony_cioption.  Note that at the time of this writing, libmruby-dev and mruby
1132c593315Sopenharmony_cipackages in Debian/Ubuntu are not usable for nghttp2, since they do
1142c593315Sopenharmony_cinot enable C++ ABI.  To build mruby, the following packages are
1152c593315Sopenharmony_cirequired:
1162c593315Sopenharmony_ci
1172c593315Sopenharmony_ci* ruby
1182c593315Sopenharmony_ci* bison
1192c593315Sopenharmony_ci
1202c593315Sopenharmony_cinghttpx supports `neverbleed <https://github.com/h2o/neverbleed>`_,
1212c593315Sopenharmony_ciprivilege separation engine for OpenSSL / LibreSSL.  In short, it
1222c593315Sopenharmony_ciminimizes the risk of private key leakage when serious bug like
1232c593315Sopenharmony_ciHeartbleed is exploited.  The neverbleed is disabled by default.  To
1242c593315Sopenharmony_cienable it, use ``--with-neverbleed`` configure option.
1252c593315Sopenharmony_ci
1262c593315Sopenharmony_ciTo enable the experimental HTTP/3 support for h2load and nghttpx, the
1272c593315Sopenharmony_cifollowing libraries are required:
1282c593315Sopenharmony_ci
1292c593315Sopenharmony_ci* `OpenSSL with QUIC support
1302c593315Sopenharmony_ci  <https://github.com/quictls/openssl/tree/OpenSSL_1_1_1w+quic>`_; or
1312c593315Sopenharmony_ci  `BoringSSL <https://boringssl.googlesource.com/boringssl/>`_ (commit
1322c593315Sopenharmony_ci  6ca49385b168f47a50e7172d82a590b218f55e4d)
1332c593315Sopenharmony_ci* `ngtcp2 <https://github.com/ngtcp2/ngtcp2>`_ >= 1.0.0
1342c593315Sopenharmony_ci* `nghttp3 <https://github.com/ngtcp2/nghttp3>`_ >= 1.0.0
1352c593315Sopenharmony_ci
1362c593315Sopenharmony_ciUse ``--enable-http3`` configure option to enable HTTP/3 feature for
1372c593315Sopenharmony_cih2load and nghttpx.
1382c593315Sopenharmony_ci
1392c593315Sopenharmony_ciIn order to build optional eBPF program to direct an incoming QUIC UDP
1402c593315Sopenharmony_cidatagram to a correct socket for nghttpx, the following libraries are
1412c593315Sopenharmony_cirequired:
1422c593315Sopenharmony_ci
1432c593315Sopenharmony_ci* libbpf-dev >= 0.7.0
1442c593315Sopenharmony_ci
1452c593315Sopenharmony_ciUse ``--with-libbpf`` configure option to build eBPF program.
1462c593315Sopenharmony_cilibelf-dev is needed to build libbpf.
1472c593315Sopenharmony_ci
1482c593315Sopenharmony_ciFor Ubuntu 20.04, you can build libbpf from `the source code
1492c593315Sopenharmony_ci<https://github.com/libbpf/libbpf/releases/tag/v1.2.2>`_.  nghttpx
1502c593315Sopenharmony_cirequires eBPF program for reloading its configuration and hot swapping
1512c593315Sopenharmony_ciits executable.
1522c593315Sopenharmony_ci
1532c593315Sopenharmony_ciCompiling libnghttp2 C source code requires a C99 compiler.  gcc 4.8
1542c593315Sopenharmony_ciis known to be adequate.  In order to compile the C++ source code, gcc
1552c593315Sopenharmony_ci>= 6.0 or clang >= 6.0 is required.  C++ source code requires C++14
1562c593315Sopenharmony_cilanguage features.
1572c593315Sopenharmony_ci
1582c593315Sopenharmony_ci.. note::
1592c593315Sopenharmony_ci
1602c593315Sopenharmony_ci   To enable mruby support in nghttpx, and use ``--with-mruby``
1612c593315Sopenharmony_ci   configure option.
1622c593315Sopenharmony_ci
1632c593315Sopenharmony_ci.. note::
1642c593315Sopenharmony_ci
1652c593315Sopenharmony_ci   Mac OS X users may need the ``--disable-threads`` configure option to
1662c593315Sopenharmony_ci   disable multi-threading in nghttpd, nghttpx and h2load to prevent
1672c593315Sopenharmony_ci   them from crashing. A patch is welcome to make multi threading work
1682c593315Sopenharmony_ci   on Mac OS X platform.
1692c593315Sopenharmony_ci
1702c593315Sopenharmony_ci.. note::
1712c593315Sopenharmony_ci
1722c593315Sopenharmony_ci   To compile the associated applications (nghttp, nghttpd, nghttpx
1732c593315Sopenharmony_ci   and h2load), you must use the ``--enable-app`` configure option and
1742c593315Sopenharmony_ci   ensure that the specified requirements above are met.  Normally,
1752c593315Sopenharmony_ci   configure script checks required dependencies to build these
1762c593315Sopenharmony_ci   applications, and enable ``--enable-app`` automatically, so you
1772c593315Sopenharmony_ci   don't have to use it explicitly.  But if you found that
1782c593315Sopenharmony_ci   applications were not built, then using ``--enable-app`` may find
1792c593315Sopenharmony_ci   that cause, such as the missing dependency.
1802c593315Sopenharmony_ci
1812c593315Sopenharmony_ci.. note::
1822c593315Sopenharmony_ci
1832c593315Sopenharmony_ci   In order to detect third party libraries, pkg-config is used
1842c593315Sopenharmony_ci   (however we don't use pkg-config for some libraries (e.g., libev)).
1852c593315Sopenharmony_ci   By default, pkg-config searches ``*.pc`` file in the standard
1862c593315Sopenharmony_ci   locations (e.g., /usr/lib/pkgconfig).  If it is necessary to use
1872c593315Sopenharmony_ci   ``*.pc`` file in the custom location, specify paths to
1882c593315Sopenharmony_ci   ``PKG_CONFIG_PATH`` environment variable, and pass it to configure
1892c593315Sopenharmony_ci   script, like so:
1902c593315Sopenharmony_ci
1912c593315Sopenharmony_ci   .. code-block:: text
1922c593315Sopenharmony_ci
1932c593315Sopenharmony_ci       $ ./configure PKG_CONFIG_PATH=/path/to/pkgconfig
1942c593315Sopenharmony_ci
1952c593315Sopenharmony_ci   For pkg-config managed libraries, ``*_CFLAG`` and ``*_LIBS``
1962c593315Sopenharmony_ci   environment variables are defined (e.g., ``OPENSSL_CFLAGS``,
1972c593315Sopenharmony_ci   ``OPENSSL_LIBS``).  Specifying non-empty string to these variables
1982c593315Sopenharmony_ci   completely overrides pkg-config.  In other words, if they are
1992c593315Sopenharmony_ci   specified, pkg-config is not used for detection, and user is
2002c593315Sopenharmony_ci   responsible to specify the correct values to these variables.  For
2012c593315Sopenharmony_ci   complete list of these variables, run ``./configure -h``.
2022c593315Sopenharmony_ci
2032c593315Sopenharmony_ciIf you are using Ubuntu 22.04 LTS, run the following to install the
2042c593315Sopenharmony_cirequired packages:
2052c593315Sopenharmony_ci
2062c593315Sopenharmony_ci.. code-block:: text
2072c593315Sopenharmony_ci
2082c593315Sopenharmony_ci    sudo apt-get install g++ clang make binutils autoconf automake \
2092c593315Sopenharmony_ci      autotools-dev libtool pkg-config \
2102c593315Sopenharmony_ci      zlib1g-dev libcunit1-dev libssl-dev libxml2-dev libev-dev \
2112c593315Sopenharmony_ci      libevent-dev libjansson-dev \
2122c593315Sopenharmony_ci      libc-ares-dev libjemalloc-dev libsystemd-dev \
2132c593315Sopenharmony_ci      ruby-dev bison libelf-dev
2142c593315Sopenharmony_ci
2152c593315Sopenharmony_ciBuilding nghttp2 from release tar archive
2162c593315Sopenharmony_ci-----------------------------------------
2172c593315Sopenharmony_ci
2182c593315Sopenharmony_ciThe nghttp2 project regularly releases tar archives which includes
2192c593315Sopenharmony_cinghttp2 source code, and generated build files.  They can be
2202c593315Sopenharmony_cidownloaded from `Releases
2212c593315Sopenharmony_ci<https://github.com/nghttp2/nghttp2/releases>`_ page.
2222c593315Sopenharmony_ci
2232c593315Sopenharmony_ciBuilding nghttp2 from git requires autotools development packages.
2242c593315Sopenharmony_ciBuilding from tar archives does not require them, and thus it is much
2252c593315Sopenharmony_cieasier.  The usual build step is as follows:
2262c593315Sopenharmony_ci
2272c593315Sopenharmony_ci.. code-block:: text
2282c593315Sopenharmony_ci
2292c593315Sopenharmony_ci    $ tar xf nghttp2-X.Y.Z.tar.bz2
2302c593315Sopenharmony_ci    $ cd nghttp2-X.Y.Z
2312c593315Sopenharmony_ci    $ ./configure
2322c593315Sopenharmony_ci    $ make
2332c593315Sopenharmony_ci
2342c593315Sopenharmony_ciBuilding from git
2352c593315Sopenharmony_ci-----------------
2362c593315Sopenharmony_ci
2372c593315Sopenharmony_ciBuilding from git is easy, but please be sure that at least autoconf 2.68 is
2382c593315Sopenharmony_ciused:
2392c593315Sopenharmony_ci
2402c593315Sopenharmony_ci.. code-block:: text
2412c593315Sopenharmony_ci
2422c593315Sopenharmony_ci    $ git submodule update --init
2432c593315Sopenharmony_ci    $ autoreconf -i
2442c593315Sopenharmony_ci    $ automake
2452c593315Sopenharmony_ci    $ autoconf
2462c593315Sopenharmony_ci    $ ./configure
2472c593315Sopenharmony_ci    $ make
2482c593315Sopenharmony_ci
2492c593315Sopenharmony_ciNotes for building on Windows (MSVC)
2502c593315Sopenharmony_ci------------------------------------
2512c593315Sopenharmony_ci
2522c593315Sopenharmony_ciThe easiest way to build native Windows nghttp2 dll is use `cmake
2532c593315Sopenharmony_ci<https://cmake.org/>`_.  The free version of `Visual C++ Build Tools
2542c593315Sopenharmony_ci<http://landinghub.visualstudio.com/visual-cpp-build-tools>`_ works
2552c593315Sopenharmony_cifine.
2562c593315Sopenharmony_ci
2572c593315Sopenharmony_ci1. Install cmake for windows
2582c593315Sopenharmony_ci2. Open "Visual C++ ... Native Build Tool Command Prompt", and inside
2592c593315Sopenharmony_ci   nghttp2 directly, run ``cmake``.
2602c593315Sopenharmony_ci3. Then run ``cmake --build`` to build library.
2612c593315Sopenharmony_ci4. nghttp2.dll, nghttp2.lib, nghttp2.exp are placed under lib directory.
2622c593315Sopenharmony_ci
2632c593315Sopenharmony_ciNote that the above steps most likely produce nghttp2 library only.
2642c593315Sopenharmony_ciNo bundled applications are compiled.
2652c593315Sopenharmony_ci
2662c593315Sopenharmony_ciNotes for building on Windows (Mingw/Cygwin)
2672c593315Sopenharmony_ci--------------------------------------------
2682c593315Sopenharmony_ci
2692c593315Sopenharmony_ciUnder Mingw environment, you can only compile the library, it's
2702c593315Sopenharmony_ci``libnghttp2-X.dll`` and ``libnghttp2.a``.
2712c593315Sopenharmony_ci
2722c593315Sopenharmony_ciIf you want to compile the applications(``h2load``, ``nghttp``,
2732c593315Sopenharmony_ci``nghttpx``, ``nghttpd``), you need to use the Cygwin environment.
2742c593315Sopenharmony_ci
2752c593315Sopenharmony_ciUnder Cygwin environment, to compile the applications you need to
2762c593315Sopenharmony_cicompile and install the libev first.
2772c593315Sopenharmony_ci
2782c593315Sopenharmony_ciSecondly, you need to undefine the macro ``__STRICT_ANSI__``, if you
2792c593315Sopenharmony_cinot, the functions ``fdopen``, ``fileno`` and ``strptime`` will not
2802c593315Sopenharmony_ciavailable.
2812c593315Sopenharmony_ci
2822c593315Sopenharmony_cithe sample command like this:
2832c593315Sopenharmony_ci
2842c593315Sopenharmony_ci.. code-block:: text
2852c593315Sopenharmony_ci
2862c593315Sopenharmony_ci    $ export CFLAGS="-U__STRICT_ANSI__ -I$libev_PREFIX/include -L$libev_PREFIX/lib"
2872c593315Sopenharmony_ci    $ export CXXFLAGS=$CFLAGS
2882c593315Sopenharmony_ci    $ ./configure
2892c593315Sopenharmony_ci    $ make
2902c593315Sopenharmony_ci
2912c593315Sopenharmony_ciIf you want to compile the applications under ``examples/``, you need
2922c593315Sopenharmony_cito remove or rename the ``event.h`` from libev's installation, because
2932c593315Sopenharmony_ciit conflicts with libevent's installation.
2942c593315Sopenharmony_ci
2952c593315Sopenharmony_ciNotes for installation on Linux systems
2962c593315Sopenharmony_ci--------------------------------------------
2972c593315Sopenharmony_ciAfter installing nghttp2 tool suite with ``make install`` one might experience a similar error:
2982c593315Sopenharmony_ci
2992c593315Sopenharmony_ci.. code-block:: text
3002c593315Sopenharmony_ci
3012c593315Sopenharmony_ci    nghttpx: error while loading shared libraries: libnghttp2.so.14: cannot open shared object file: No such file or directory
3022c593315Sopenharmony_ci
3032c593315Sopenharmony_ciThis means that the tool is unable to locate the ``libnghttp2.so`` shared library.
3042c593315Sopenharmony_ci
3052c593315Sopenharmony_ciTo update the shared library cache run ``sudo ldconfig``.
3062c593315Sopenharmony_ci
3072c593315Sopenharmony_ciBuilding the documentation
3082c593315Sopenharmony_ci--------------------------
3092c593315Sopenharmony_ci
3102c593315Sopenharmony_ci.. note::
3112c593315Sopenharmony_ci
3122c593315Sopenharmony_ci   Documentation is still incomplete.
3132c593315Sopenharmony_ci
3142c593315Sopenharmony_ciTo build the documentation, run:
3152c593315Sopenharmony_ci
3162c593315Sopenharmony_ci.. code-block:: text
3172c593315Sopenharmony_ci
3182c593315Sopenharmony_ci    $ make html
3192c593315Sopenharmony_ci
3202c593315Sopenharmony_ciThe documents will be generated under ``doc/manual/html/``.
3212c593315Sopenharmony_ci
3222c593315Sopenharmony_ciThe generated documents will not be installed with ``make install``.
3232c593315Sopenharmony_ci
3242c593315Sopenharmony_ciThe online documentation is available at
3252c593315Sopenharmony_cihttps://nghttp2.org/documentation/
3262c593315Sopenharmony_ci
3272c593315Sopenharmony_ciBuild HTTP/3 enabled h2load and nghttpx
3282c593315Sopenharmony_ci---------------------------------------
3292c593315Sopenharmony_ci
3302c593315Sopenharmony_ciTo build h2load and nghttpx with HTTP/3 feature enabled, run the
3312c593315Sopenharmony_ciconfigure script with ``--enable-http3``.
3322c593315Sopenharmony_ci
3332c593315Sopenharmony_ciFor nghttpx to reload configurations and swapping its executable while
3342c593315Sopenharmony_cigracefully terminating old worker processes, eBPF is required.  Run
3352c593315Sopenharmony_cithe configure script with ``--enable-http3 --with-libbpf`` to build
3362c593315Sopenharmony_cieBPF program.  The QUIC keying material must be set with
3372c593315Sopenharmony_ci``--frontend-quic-secret-file`` in order to keep the existing
3382c593315Sopenharmony_ciconnections alive during reload.
3392c593315Sopenharmony_ci
3402c593315Sopenharmony_ciThe detailed steps to build HTTP/3 enabled h2load and nghttpx follow.
3412c593315Sopenharmony_ci
3422c593315Sopenharmony_ciBuild custom OpenSSL:
3432c593315Sopenharmony_ci
3442c593315Sopenharmony_ci.. code-block:: text
3452c593315Sopenharmony_ci
3462c593315Sopenharmony_ci   $ git clone --depth 1 -b OpenSSL_1_1_1w+quic https://github.com/quictls/openssl
3472c593315Sopenharmony_ci   $ cd openssl
3482c593315Sopenharmony_ci   $ ./config --prefix=$PWD/build --openssldir=/etc/ssl
3492c593315Sopenharmony_ci   $ make -j$(nproc)
3502c593315Sopenharmony_ci   $ make install_sw
3512c593315Sopenharmony_ci   $ cd ..
3522c593315Sopenharmony_ci
3532c593315Sopenharmony_ciBuild nghttp3:
3542c593315Sopenharmony_ci
3552c593315Sopenharmony_ci.. code-block:: text
3562c593315Sopenharmony_ci
3572c593315Sopenharmony_ci   $ git clone --depth 1 -b v1.0.0 https://github.com/ngtcp2/nghttp3
3582c593315Sopenharmony_ci   $ cd nghttp3
3592c593315Sopenharmony_ci   $ autoreconf -i
3602c593315Sopenharmony_ci   $ ./configure --prefix=$PWD/build --enable-lib-only
3612c593315Sopenharmony_ci   $ make -j$(nproc)
3622c593315Sopenharmony_ci   $ make install
3632c593315Sopenharmony_ci   $ cd ..
3642c593315Sopenharmony_ci
3652c593315Sopenharmony_ciBuild ngtcp2:
3662c593315Sopenharmony_ci
3672c593315Sopenharmony_ci.. code-block:: text
3682c593315Sopenharmony_ci
3692c593315Sopenharmony_ci   $ git clone --depth 1 -b v1.0.1 https://github.com/ngtcp2/ngtcp2
3702c593315Sopenharmony_ci   $ cd ngtcp2
3712c593315Sopenharmony_ci   $ autoreconf -i
3722c593315Sopenharmony_ci   $ ./configure --prefix=$PWD/build --enable-lib-only \
3732c593315Sopenharmony_ci         PKG_CONFIG_PATH="$PWD/../openssl/build/lib/pkgconfig"
3742c593315Sopenharmony_ci   $ make -j$(nproc)
3752c593315Sopenharmony_ci   $ make install
3762c593315Sopenharmony_ci   $ cd ..
3772c593315Sopenharmony_ci
3782c593315Sopenharmony_ciIf your Linux distribution does not have libbpf-dev >= 0.7.0, build
3792c593315Sopenharmony_cifrom source:
3802c593315Sopenharmony_ci
3812c593315Sopenharmony_ci.. code-block:: text
3822c593315Sopenharmony_ci
3832c593315Sopenharmony_ci   $ git clone --depth 1 -b v1.2.2 https://github.com/libbpf/libbpf
3842c593315Sopenharmony_ci   $ cd libbpf
3852c593315Sopenharmony_ci   $ PREFIX=$PWD/build make -C src install
3862c593315Sopenharmony_ci   $ cd ..
3872c593315Sopenharmony_ci
3882c593315Sopenharmony_ciBuild nghttp2:
3892c593315Sopenharmony_ci
3902c593315Sopenharmony_ci.. code-block:: text
3912c593315Sopenharmony_ci
3922c593315Sopenharmony_ci   $ git clone https://github.com/nghttp2/nghttp2
3932c593315Sopenharmony_ci   $ cd nghttp2
3942c593315Sopenharmony_ci   $ git submodule update --init
3952c593315Sopenharmony_ci   $ autoreconf -i
3962c593315Sopenharmony_ci   $ ./configure --with-mruby --with-neverbleed --enable-http3 --with-libbpf \
3972c593315Sopenharmony_ci         CC=clang-14 CXX=clang++-14 \
3982c593315Sopenharmony_ci         PKG_CONFIG_PATH="$PWD/../openssl/build/lib/pkgconfig:$PWD/../nghttp3/build/lib/pkgconfig:$PWD/../ngtcp2/build/lib/pkgconfig:$PWD/../libbpf/build/lib64/pkgconfig" \
3992c593315Sopenharmony_ci         LDFLAGS="$LDFLAGS -Wl,-rpath,$PWD/../openssl/build/lib -Wl,-rpath,$PWD/../libbpf/build/lib64"
4002c593315Sopenharmony_ci   $ make -j$(nproc)
4012c593315Sopenharmony_ci
4022c593315Sopenharmony_ciThe eBPF program ``reuseport_kern.o`` should be found under bpf
4032c593315Sopenharmony_cidirectory.  Pass ``--quic-bpf-program-file=bpf/reuseport_kern.o``
4042c593315Sopenharmony_cioption to nghttpx to load it.  See also `HTTP/3 section in nghttpx -
4052c593315Sopenharmony_ciHTTP/2 proxy - HOW-TO
4062c593315Sopenharmony_ci<https://nghttp2.org/documentation/nghttpx-howto.html#http-3>`_.
4072c593315Sopenharmony_ci
4082c593315Sopenharmony_ciUnit tests
4092c593315Sopenharmony_ci----------
4102c593315Sopenharmony_ci
4112c593315Sopenharmony_ciUnit tests are done by simply running ``make check``.
4122c593315Sopenharmony_ci
4132c593315Sopenharmony_ciIntegration tests
4142c593315Sopenharmony_ci-----------------
4152c593315Sopenharmony_ci
4162c593315Sopenharmony_ciWe have the integration tests for the nghttpx proxy server.  The tests are
4172c593315Sopenharmony_ciwritten in the `Go programming language <http://golang.org/>`_ and uses
4182c593315Sopenharmony_ciits testing framework.  We depend on the following libraries:
4192c593315Sopenharmony_ci
4202c593315Sopenharmony_ci* golang.org/x/net/http2
4212c593315Sopenharmony_ci* golang.org/x/net/websocket
4222c593315Sopenharmony_ci* https://github.com/tatsuhiro-t/go-nghttp2
4232c593315Sopenharmony_ci
4242c593315Sopenharmony_ciGo modules will download these dependencies automatically.
4252c593315Sopenharmony_ci
4262c593315Sopenharmony_ciTo run the tests, run the following command under
4272c593315Sopenharmony_ci``integration-tests`` directory:
4282c593315Sopenharmony_ci
4292c593315Sopenharmony_ci.. code-block:: text
4302c593315Sopenharmony_ci
4312c593315Sopenharmony_ci    $ make it
4322c593315Sopenharmony_ci
4332c593315Sopenharmony_ciInside the tests, we use port 3009 to run the test subject server.
4342c593315Sopenharmony_ci
4352c593315Sopenharmony_ciMigration from v0.7.15 or earlier
4362c593315Sopenharmony_ci---------------------------------
4372c593315Sopenharmony_ci
4382c593315Sopenharmony_cinghttp2 v1.0.0 introduced several backward incompatible changes.  In
4392c593315Sopenharmony_cithis section, we describe these changes and how to migrate to v1.0.0.
4402c593315Sopenharmony_ci
4412c593315Sopenharmony_ciALPN protocol ID is now ``h2`` and ``h2c``
4422c593315Sopenharmony_ci++++++++++++++++++++++++++++++++++++++++++
4432c593315Sopenharmony_ci
4442c593315Sopenharmony_ciPreviously we announced ``h2-14`` and ``h2c-14``.  v1.0.0 implements
4452c593315Sopenharmony_cifinal protocol version, and we changed ALPN ID to ``h2`` and ``h2c``.
4462c593315Sopenharmony_ciThe macros ``NGHTTP2_PROTO_VERSION_ID``,
4472c593315Sopenharmony_ci``NGHTTP2_PROTO_VERSION_ID_LEN``,
4482c593315Sopenharmony_ci``NGHTTP2_CLEARTEXT_PROTO_VERSION_ID``, and
4492c593315Sopenharmony_ci``NGHTTP2_CLEARTEXT_PROTO_VERSION_ID_LEN`` have been updated to
4502c593315Sopenharmony_cireflect this change.
4512c593315Sopenharmony_ci
4522c593315Sopenharmony_ciBasically, existing applications do not have to do anything, just
4532c593315Sopenharmony_cirecompiling is enough for this change.
4542c593315Sopenharmony_ci
4552c593315Sopenharmony_ciUse word "client magic" where we use "client connection preface"
4562c593315Sopenharmony_ci++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4572c593315Sopenharmony_ci
4582c593315Sopenharmony_ciWe use "client connection preface" to mean first 24 bytes of client
4592c593315Sopenharmony_ciconnection preface.  This is technically not correct, since client
4602c593315Sopenharmony_ciconnection preface is composed of 24 bytes client magic byte string
4612c593315Sopenharmony_cifollowed by SETTINGS frame.  For clarification, we call "client magic"
4622c593315Sopenharmony_cifor this 24 bytes byte string and updated API.
4632c593315Sopenharmony_ci
4642c593315Sopenharmony_ci* ``NGHTTP2_CLIENT_CONNECTION_PREFACE`` was replaced with
4652c593315Sopenharmony_ci  ``NGHTTP2_CLIENT_MAGIC``.
4662c593315Sopenharmony_ci* ``NGHTTP2_CLIENT_CONNECTION_PREFACE_LEN`` was replaced with
4672c593315Sopenharmony_ci  ``NGHTTP2_CLIENT_MAGIC_LEN``.
4682c593315Sopenharmony_ci* ``NGHTTP2_BAD_PREFACE`` was renamed as ``NGHTTP2_BAD_CLIENT_MAGIC``
4692c593315Sopenharmony_ci
4702c593315Sopenharmony_ciThe already deprecated ``NGHTTP2_CLIENT_CONNECTION_HEADER`` and
4712c593315Sopenharmony_ci``NGHTTP2_CLIENT_CONNECTION_HEADER_LEN`` were removed.
4722c593315Sopenharmony_ci
4732c593315Sopenharmony_ciIf application uses these macros, just replace old ones with new ones.
4742c593315Sopenharmony_ciSince v1.0.0, client magic is sent by library (see next subsection),
4752c593315Sopenharmony_ciso client application may just remove these macro use.
4762c593315Sopenharmony_ci
4772c593315Sopenharmony_ciClient magic is sent by library
4782c593315Sopenharmony_ci+++++++++++++++++++++++++++++++
4792c593315Sopenharmony_ci
4802c593315Sopenharmony_ciPreviously nghttp2 library did not send client magic, which is first
4812c593315Sopenharmony_ci24 bytes byte string of client connection preface, and client
4822c593315Sopenharmony_ciapplications have to send it by themselves.  Since v1.0.0, client
4832c593315Sopenharmony_cimagic is sent by library via first call of ``nghttp2_session_send()``
4842c593315Sopenharmony_cior ``nghttp2_session_mem_send()``.
4852c593315Sopenharmony_ci
4862c593315Sopenharmony_ciThe client applications which send client magic must remove the
4872c593315Sopenharmony_cirelevant code.
4882c593315Sopenharmony_ci
4892c593315Sopenharmony_ciRemove HTTP Alternative Services (Alt-Svc) related code
4902c593315Sopenharmony_ci+++++++++++++++++++++++++++++++++++++++++++++++++++++++
4912c593315Sopenharmony_ci
4922c593315Sopenharmony_ciAlt-Svc specification is not finalized yet.  To make our API stable,
4932c593315Sopenharmony_ciwe have decided to remove all Alt-Svc related API from nghttp2.
4942c593315Sopenharmony_ci
4952c593315Sopenharmony_ci* ``NGHTTP2_EXT_ALTSVC`` was removed.
4962c593315Sopenharmony_ci* ``nghttp2_ext_altsvc`` was removed.
4972c593315Sopenharmony_ci
4982c593315Sopenharmony_ciWe have already removed the functionality of Alt-Svc in v0.7 series
4992c593315Sopenharmony_ciand they have been essentially noop.  The application using these
5002c593315Sopenharmony_cimacro and struct, remove those lines.
5012c593315Sopenharmony_ci
5022c593315Sopenharmony_ciUse nghttp2_error in nghttp2_on_invalid_frame_recv_callback
5032c593315Sopenharmony_ci+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
5042c593315Sopenharmony_ci
5052c593315Sopenharmony_ciPreviously ``nghttp2_on_invalid_frame_recv_cb_called`` took the
5062c593315Sopenharmony_ci``error_code``, defined in ``nghttp2_error_code``, as parameter.  But
5072c593315Sopenharmony_cithey are not detailed enough to debug.  Therefore, we decided to use
5082c593315Sopenharmony_cimore detailed ``nghttp2_error`` values instead.
5092c593315Sopenharmony_ci
5102c593315Sopenharmony_ciThe application using this callback should update the callback
5112c593315Sopenharmony_cisignature.  If it treats ``error_code`` as HTTP/2 error code, update
5122c593315Sopenharmony_cithe code so that it is treated as ``nghttp2_error``.
5132c593315Sopenharmony_ci
5142c593315Sopenharmony_ciReceive client magic by default
5152c593315Sopenharmony_ci+++++++++++++++++++++++++++++++
5162c593315Sopenharmony_ci
5172c593315Sopenharmony_ciPreviously nghttp2 did not process client magic (24 bytes byte
5182c593315Sopenharmony_cistring).  To make it deal with it, we had to use
5192c593315Sopenharmony_ci``nghttp2_option_set_recv_client_preface()``.  Since v1.0.0, nghttp2
5202c593315Sopenharmony_ciprocesses client magic by default and
5212c593315Sopenharmony_ci``nghttp2_option_set_recv_client_preface()`` was removed.
5222c593315Sopenharmony_ci
5232c593315Sopenharmony_ciSome application may want to disable this behaviour, so we added
5242c593315Sopenharmony_ci``nghttp2_option_set_no_recv_client_magic()`` to achieve this.
5252c593315Sopenharmony_ci
5262c593315Sopenharmony_ciThe application using ``nghttp2_option_set_recv_client_preface()``
5272c593315Sopenharmony_ciwith nonzero value, just remove it.
5282c593315Sopenharmony_ci
5292c593315Sopenharmony_ciThe application using ``nghttp2_option_set_recv_client_preface()``
5302c593315Sopenharmony_ciwith zero value or not using it must use
5312c593315Sopenharmony_ci``nghttp2_option_set_no_recv_client_magic()`` with nonzero value.
5322c593315Sopenharmony_ci
5332c593315Sopenharmony_ciClient, Server and Proxy programs
5342c593315Sopenharmony_ci---------------------------------
5352c593315Sopenharmony_ci
5362c593315Sopenharmony_ciThe ``src`` directory contains the HTTP/2 client, server and proxy programs.
5372c593315Sopenharmony_ci
5382c593315Sopenharmony_cinghttp - client
5392c593315Sopenharmony_ci+++++++++++++++
5402c593315Sopenharmony_ci
5412c593315Sopenharmony_ci``nghttp`` is a HTTP/2 client.  It can connect to the HTTP/2 server
5422c593315Sopenharmony_ciwith prior knowledge, HTTP Upgrade and NPN/ALPN TLS extension.
5432c593315Sopenharmony_ci
5442c593315Sopenharmony_ciIt has verbose output mode for framing information.  Here is sample
5452c593315Sopenharmony_cioutput from ``nghttp`` client:
5462c593315Sopenharmony_ci
5472c593315Sopenharmony_ci.. code-block:: text
5482c593315Sopenharmony_ci
5492c593315Sopenharmony_ci    $ nghttp -nv https://nghttp2.org
5502c593315Sopenharmony_ci    [  0.190] Connected
5512c593315Sopenharmony_ci    The negotiated protocol: h2
5522c593315Sopenharmony_ci    [  0.212] recv SETTINGS frame <length=12, flags=0x00, stream_id=0>
5532c593315Sopenharmony_ci	      (niv=2)
5542c593315Sopenharmony_ci	      [SETTINGS_MAX_CONCURRENT_STREAMS(0x03):100]
5552c593315Sopenharmony_ci	      [SETTINGS_INITIAL_WINDOW_SIZE(0x04):65535]
5562c593315Sopenharmony_ci    [  0.212] send SETTINGS frame <length=12, flags=0x00, stream_id=0>
5572c593315Sopenharmony_ci	      (niv=2)
5582c593315Sopenharmony_ci	      [SETTINGS_MAX_CONCURRENT_STREAMS(0x03):100]
5592c593315Sopenharmony_ci	      [SETTINGS_INITIAL_WINDOW_SIZE(0x04):65535]
5602c593315Sopenharmony_ci    [  0.212] send SETTINGS frame <length=0, flags=0x01, stream_id=0>
5612c593315Sopenharmony_ci	      ; ACK
5622c593315Sopenharmony_ci	      (niv=0)
5632c593315Sopenharmony_ci    [  0.212] send PRIORITY frame <length=5, flags=0x00, stream_id=3>
5642c593315Sopenharmony_ci	      (dep_stream_id=0, weight=201, exclusive=0)
5652c593315Sopenharmony_ci    [  0.212] send PRIORITY frame <length=5, flags=0x00, stream_id=5>
5662c593315Sopenharmony_ci	      (dep_stream_id=0, weight=101, exclusive=0)
5672c593315Sopenharmony_ci    [  0.212] send PRIORITY frame <length=5, flags=0x00, stream_id=7>
5682c593315Sopenharmony_ci	      (dep_stream_id=0, weight=1, exclusive=0)
5692c593315Sopenharmony_ci    [  0.212] send PRIORITY frame <length=5, flags=0x00, stream_id=9>
5702c593315Sopenharmony_ci	      (dep_stream_id=7, weight=1, exclusive=0)
5712c593315Sopenharmony_ci    [  0.212] send PRIORITY frame <length=5, flags=0x00, stream_id=11>
5722c593315Sopenharmony_ci	      (dep_stream_id=3, weight=1, exclusive=0)
5732c593315Sopenharmony_ci    [  0.212] send HEADERS frame <length=39, flags=0x25, stream_id=13>
5742c593315Sopenharmony_ci	      ; END_STREAM | END_HEADERS | PRIORITY
5752c593315Sopenharmony_ci	      (padlen=0, dep_stream_id=11, weight=16, exclusive=0)
5762c593315Sopenharmony_ci	      ; Open new stream
5772c593315Sopenharmony_ci	      :method: GET
5782c593315Sopenharmony_ci	      :path: /
5792c593315Sopenharmony_ci	      :scheme: https
5802c593315Sopenharmony_ci	      :authority: nghttp2.org
5812c593315Sopenharmony_ci	      accept: */*
5822c593315Sopenharmony_ci	      accept-encoding: gzip, deflate
5832c593315Sopenharmony_ci	      user-agent: nghttp2/1.0.1-DEV
5842c593315Sopenharmony_ci    [  0.221] recv SETTINGS frame <length=0, flags=0x01, stream_id=0>
5852c593315Sopenharmony_ci	      ; ACK
5862c593315Sopenharmony_ci	      (niv=0)
5872c593315Sopenharmony_ci    [  0.221] recv (stream_id=13) :method: GET
5882c593315Sopenharmony_ci    [  0.221] recv (stream_id=13) :scheme: https
5892c593315Sopenharmony_ci    [  0.221] recv (stream_id=13) :path: /stylesheets/screen.css
5902c593315Sopenharmony_ci    [  0.221] recv (stream_id=13) :authority: nghttp2.org
5912c593315Sopenharmony_ci    [  0.221] recv (stream_id=13) accept-encoding: gzip, deflate
5922c593315Sopenharmony_ci    [  0.222] recv (stream_id=13) user-agent: nghttp2/1.0.1-DEV
5932c593315Sopenharmony_ci    [  0.222] recv PUSH_PROMISE frame <length=50, flags=0x04, stream_id=13>
5942c593315Sopenharmony_ci	      ; END_HEADERS
5952c593315Sopenharmony_ci	      (padlen=0, promised_stream_id=2)
5962c593315Sopenharmony_ci    [  0.222] recv (stream_id=13) :status: 200
5972c593315Sopenharmony_ci    [  0.222] recv (stream_id=13) date: Thu, 21 May 2015 16:38:14 GMT
5982c593315Sopenharmony_ci    [  0.222] recv (stream_id=13) content-type: text/html
5992c593315Sopenharmony_ci    [  0.222] recv (stream_id=13) last-modified: Fri, 15 May 2015 15:38:06 GMT
6002c593315Sopenharmony_ci    [  0.222] recv (stream_id=13) etag: W/"555612de-19f6"
6012c593315Sopenharmony_ci    [  0.222] recv (stream_id=13) link: </stylesheets/screen.css>; rel=preload; as=stylesheet
6022c593315Sopenharmony_ci    [  0.222] recv (stream_id=13) content-encoding: gzip
6032c593315Sopenharmony_ci    [  0.222] recv (stream_id=13) server: nghttpx nghttp2/1.0.1-DEV
6042c593315Sopenharmony_ci    [  0.222] recv (stream_id=13) via: 1.1 nghttpx
6052c593315Sopenharmony_ci    [  0.222] recv (stream_id=13) strict-transport-security: max-age=31536000
6062c593315Sopenharmony_ci    [  0.222] recv HEADERS frame <length=166, flags=0x04, stream_id=13>
6072c593315Sopenharmony_ci	      ; END_HEADERS
6082c593315Sopenharmony_ci	      (padlen=0)
6092c593315Sopenharmony_ci	      ; First response header
6102c593315Sopenharmony_ci    [  0.222] recv DATA frame <length=2601, flags=0x01, stream_id=13>
6112c593315Sopenharmony_ci	      ; END_STREAM
6122c593315Sopenharmony_ci    [  0.222] recv (stream_id=2) :status: 200
6132c593315Sopenharmony_ci    [  0.222] recv (stream_id=2) date: Thu, 21 May 2015 16:38:14 GMT
6142c593315Sopenharmony_ci    [  0.222] recv (stream_id=2) content-type: text/css
6152c593315Sopenharmony_ci    [  0.222] recv (stream_id=2) last-modified: Fri, 15 May 2015 15:38:06 GMT
6162c593315Sopenharmony_ci    [  0.222] recv (stream_id=2) etag: W/"555612de-9845"
6172c593315Sopenharmony_ci    [  0.222] recv (stream_id=2) content-encoding: gzip
6182c593315Sopenharmony_ci    [  0.222] recv (stream_id=2) server: nghttpx nghttp2/1.0.1-DEV
6192c593315Sopenharmony_ci    [  0.222] recv (stream_id=2) via: 1.1 nghttpx
6202c593315Sopenharmony_ci    [  0.222] recv (stream_id=2) strict-transport-security: max-age=31536000
6212c593315Sopenharmony_ci    [  0.222] recv HEADERS frame <length=32, flags=0x04, stream_id=2>
6222c593315Sopenharmony_ci	      ; END_HEADERS
6232c593315Sopenharmony_ci	      (padlen=0)
6242c593315Sopenharmony_ci	      ; First push response header
6252c593315Sopenharmony_ci    [  0.228] recv DATA frame <length=8715, flags=0x01, stream_id=2>
6262c593315Sopenharmony_ci	      ; END_STREAM
6272c593315Sopenharmony_ci    [  0.228] send GOAWAY frame <length=8, flags=0x00, stream_id=0>
6282c593315Sopenharmony_ci	      (last_stream_id=2, error_code=NO_ERROR(0x00), opaque_data(0)=[])
6292c593315Sopenharmony_ci
6302c593315Sopenharmony_ciThe HTTP Upgrade is performed like so:
6312c593315Sopenharmony_ci
6322c593315Sopenharmony_ci.. code-block:: text
6332c593315Sopenharmony_ci
6342c593315Sopenharmony_ci    $ nghttp -nvu http://nghttp2.org
6352c593315Sopenharmony_ci    [  0.011] Connected
6362c593315Sopenharmony_ci    [  0.011] HTTP Upgrade request
6372c593315Sopenharmony_ci    GET / HTTP/1.1
6382c593315Sopenharmony_ci    Host: nghttp2.org
6392c593315Sopenharmony_ci    Connection: Upgrade, HTTP2-Settings
6402c593315Sopenharmony_ci    Upgrade: h2c
6412c593315Sopenharmony_ci    HTTP2-Settings: AAMAAABkAAQAAP__
6422c593315Sopenharmony_ci    Accept: */*
6432c593315Sopenharmony_ci    User-Agent: nghttp2/1.0.1-DEV
6442c593315Sopenharmony_ci
6452c593315Sopenharmony_ci
6462c593315Sopenharmony_ci    [  0.018] HTTP Upgrade response
6472c593315Sopenharmony_ci    HTTP/1.1 101 Switching Protocols
6482c593315Sopenharmony_ci    Connection: Upgrade
6492c593315Sopenharmony_ci    Upgrade: h2c
6502c593315Sopenharmony_ci
6512c593315Sopenharmony_ci
6522c593315Sopenharmony_ci    [  0.018] HTTP Upgrade success
6532c593315Sopenharmony_ci    [  0.018] recv SETTINGS frame <length=12, flags=0x00, stream_id=0>
6542c593315Sopenharmony_ci	      (niv=2)
6552c593315Sopenharmony_ci	      [SETTINGS_MAX_CONCURRENT_STREAMS(0x03):100]
6562c593315Sopenharmony_ci	      [SETTINGS_INITIAL_WINDOW_SIZE(0x04):65535]
6572c593315Sopenharmony_ci    [  0.018] send SETTINGS frame <length=12, flags=0x00, stream_id=0>
6582c593315Sopenharmony_ci	      (niv=2)
6592c593315Sopenharmony_ci	      [SETTINGS_MAX_CONCURRENT_STREAMS(0x03):100]
6602c593315Sopenharmony_ci	      [SETTINGS_INITIAL_WINDOW_SIZE(0x04):65535]
6612c593315Sopenharmony_ci    [  0.018] send SETTINGS frame <length=0, flags=0x01, stream_id=0>
6622c593315Sopenharmony_ci	      ; ACK
6632c593315Sopenharmony_ci	      (niv=0)
6642c593315Sopenharmony_ci    [  0.018] send PRIORITY frame <length=5, flags=0x00, stream_id=3>
6652c593315Sopenharmony_ci	      (dep_stream_id=0, weight=201, exclusive=0)
6662c593315Sopenharmony_ci    [  0.018] send PRIORITY frame <length=5, flags=0x00, stream_id=5>
6672c593315Sopenharmony_ci	      (dep_stream_id=0, weight=101, exclusive=0)
6682c593315Sopenharmony_ci    [  0.018] send PRIORITY frame <length=5, flags=0x00, stream_id=7>
6692c593315Sopenharmony_ci	      (dep_stream_id=0, weight=1, exclusive=0)
6702c593315Sopenharmony_ci    [  0.018] send PRIORITY frame <length=5, flags=0x00, stream_id=9>
6712c593315Sopenharmony_ci	      (dep_stream_id=7, weight=1, exclusive=0)
6722c593315Sopenharmony_ci    [  0.018] send PRIORITY frame <length=5, flags=0x00, stream_id=11>
6732c593315Sopenharmony_ci	      (dep_stream_id=3, weight=1, exclusive=0)
6742c593315Sopenharmony_ci    [  0.018] send PRIORITY frame <length=5, flags=0x00, stream_id=1>
6752c593315Sopenharmony_ci	      (dep_stream_id=11, weight=16, exclusive=0)
6762c593315Sopenharmony_ci    [  0.019] recv (stream_id=1) :method: GET
6772c593315Sopenharmony_ci    [  0.019] recv (stream_id=1) :scheme: http
6782c593315Sopenharmony_ci    [  0.019] recv (stream_id=1) :path: /stylesheets/screen.css
6792c593315Sopenharmony_ci    [  0.019] recv (stream_id=1) host: nghttp2.org
6802c593315Sopenharmony_ci    [  0.019] recv (stream_id=1) user-agent: nghttp2/1.0.1-DEV
6812c593315Sopenharmony_ci    [  0.019] recv PUSH_PROMISE frame <length=49, flags=0x04, stream_id=1>
6822c593315Sopenharmony_ci	      ; END_HEADERS
6832c593315Sopenharmony_ci	      (padlen=0, promised_stream_id=2)
6842c593315Sopenharmony_ci    [  0.019] recv (stream_id=1) :status: 200
6852c593315Sopenharmony_ci    [  0.019] recv (stream_id=1) date: Thu, 21 May 2015 16:39:16 GMT
6862c593315Sopenharmony_ci    [  0.019] recv (stream_id=1) content-type: text/html
6872c593315Sopenharmony_ci    [  0.019] recv (stream_id=1) content-length: 6646
6882c593315Sopenharmony_ci    [  0.019] recv (stream_id=1) last-modified: Fri, 15 May 2015 15:38:06 GMT
6892c593315Sopenharmony_ci    [  0.019] recv (stream_id=1) etag: "555612de-19f6"
6902c593315Sopenharmony_ci    [  0.019] recv (stream_id=1) link: </stylesheets/screen.css>; rel=preload; as=stylesheet
6912c593315Sopenharmony_ci    [  0.019] recv (stream_id=1) accept-ranges: bytes
6922c593315Sopenharmony_ci    [  0.019] recv (stream_id=1) server: nghttpx nghttp2/1.0.1-DEV
6932c593315Sopenharmony_ci    [  0.019] recv (stream_id=1) via: 1.1 nghttpx
6942c593315Sopenharmony_ci    [  0.019] recv HEADERS frame <length=157, flags=0x04, stream_id=1>
6952c593315Sopenharmony_ci	      ; END_HEADERS
6962c593315Sopenharmony_ci	      (padlen=0)
6972c593315Sopenharmony_ci	      ; First response header
6982c593315Sopenharmony_ci    [  0.019] recv DATA frame <length=6646, flags=0x01, stream_id=1>
6992c593315Sopenharmony_ci	      ; END_STREAM
7002c593315Sopenharmony_ci    [  0.019] recv (stream_id=2) :status: 200
7012c593315Sopenharmony_ci    [  0.019] recv (stream_id=2) date: Thu, 21 May 2015 16:39:16 GMT
7022c593315Sopenharmony_ci    [  0.019] recv (stream_id=2) content-type: text/css
7032c593315Sopenharmony_ci    [  0.019] recv (stream_id=2) content-length: 38981
7042c593315Sopenharmony_ci    [  0.019] recv (stream_id=2) last-modified: Fri, 15 May 2015 15:38:06 GMT
7052c593315Sopenharmony_ci    [  0.019] recv (stream_id=2) etag: "555612de-9845"
7062c593315Sopenharmony_ci    [  0.019] recv (stream_id=2) accept-ranges: bytes
7072c593315Sopenharmony_ci    [  0.019] recv (stream_id=2) server: nghttpx nghttp2/1.0.1-DEV
7082c593315Sopenharmony_ci    [  0.019] recv (stream_id=2) via: 1.1 nghttpx
7092c593315Sopenharmony_ci    [  0.019] recv HEADERS frame <length=36, flags=0x04, stream_id=2>
7102c593315Sopenharmony_ci	      ; END_HEADERS
7112c593315Sopenharmony_ci	      (padlen=0)
7122c593315Sopenharmony_ci	      ; First push response header
7132c593315Sopenharmony_ci    [  0.026] recv DATA frame <length=16384, flags=0x00, stream_id=2>
7142c593315Sopenharmony_ci    [  0.027] recv DATA frame <length=7952, flags=0x00, stream_id=2>
7152c593315Sopenharmony_ci    [  0.027] send WINDOW_UPDATE frame <length=4, flags=0x00, stream_id=0>
7162c593315Sopenharmony_ci	      (window_size_increment=33343)
7172c593315Sopenharmony_ci    [  0.032] send WINDOW_UPDATE frame <length=4, flags=0x00, stream_id=2>
7182c593315Sopenharmony_ci	      (window_size_increment=33707)
7192c593315Sopenharmony_ci    [  0.032] recv DATA frame <length=14645, flags=0x01, stream_id=2>
7202c593315Sopenharmony_ci	      ; END_STREAM
7212c593315Sopenharmony_ci    [  0.032] recv SETTINGS frame <length=0, flags=0x01, stream_id=0>
7222c593315Sopenharmony_ci	      ; ACK
7232c593315Sopenharmony_ci	      (niv=0)
7242c593315Sopenharmony_ci    [  0.032] send GOAWAY frame <length=8, flags=0x00, stream_id=0>
7252c593315Sopenharmony_ci	      (last_stream_id=2, error_code=NO_ERROR(0x00), opaque_data(0)=[])
7262c593315Sopenharmony_ci
7272c593315Sopenharmony_ciUsing the ``-s`` option, ``nghttp`` prints out some timing information for
7282c593315Sopenharmony_cirequests, sorted by completion time:
7292c593315Sopenharmony_ci
7302c593315Sopenharmony_ci.. code-block:: text
7312c593315Sopenharmony_ci
7322c593315Sopenharmony_ci    $ nghttp -nas https://nghttp2.org/
7332c593315Sopenharmony_ci    ***** Statistics *****
7342c593315Sopenharmony_ci
7352c593315Sopenharmony_ci    Request timing:
7362c593315Sopenharmony_ci      responseEnd: the  time  when  last  byte of  response  was  received
7372c593315Sopenharmony_ci                   relative to connectEnd
7382c593315Sopenharmony_ci     requestStart: the time  just before  first byte  of request  was sent
7392c593315Sopenharmony_ci                   relative  to connectEnd.   If  '*' is  shown, this  was
7402c593315Sopenharmony_ci                   pushed by server.
7412c593315Sopenharmony_ci          process: responseEnd - requestStart
7422c593315Sopenharmony_ci             code: HTTP status code
7432c593315Sopenharmony_ci             size: number  of  bytes  received as  response  body  without
7442c593315Sopenharmony_ci                   inflation.
7452c593315Sopenharmony_ci              URI: request URI
7462c593315Sopenharmony_ci
7472c593315Sopenharmony_ci    see http://www.w3.org/TR/resource-timing/#processing-model
7482c593315Sopenharmony_ci
7492c593315Sopenharmony_ci    sorted by 'complete'
7502c593315Sopenharmony_ci
7512c593315Sopenharmony_ci    id  responseEnd requestStart  process code size request path
7522c593315Sopenharmony_ci     13    +37.19ms       +280us  36.91ms  200   2K /
7532c593315Sopenharmony_ci      2    +72.65ms *   +36.38ms  36.26ms  200   8K /stylesheets/screen.css
7542c593315Sopenharmony_ci     17    +77.43ms     +38.67ms  38.75ms  200   3K /javascripts/octopress.js
7552c593315Sopenharmony_ci     15    +78.12ms     +38.66ms  39.46ms  200   3K /javascripts/modernizr-2.0.js
7562c593315Sopenharmony_ci
7572c593315Sopenharmony_ciUsing the ``-r`` option, ``nghttp`` writes more detailed timing data to
7582c593315Sopenharmony_cithe given file in HAR format.
7592c593315Sopenharmony_ci
7602c593315Sopenharmony_cinghttpd - server
7612c593315Sopenharmony_ci++++++++++++++++
7622c593315Sopenharmony_ci
7632c593315Sopenharmony_ci``nghttpd`` is a multi-threaded static web server.
7642c593315Sopenharmony_ci
7652c593315Sopenharmony_ciBy default, it uses SSL/TLS connection.  Use ``--no-tls`` option to
7662c593315Sopenharmony_cidisable it.
7672c593315Sopenharmony_ci
7682c593315Sopenharmony_ci``nghttpd`` only accepts HTTP/2 connections via NPN/ALPN or direct
7692c593315Sopenharmony_ciHTTP/2 connections.  No HTTP Upgrade is supported.
7702c593315Sopenharmony_ci
7712c593315Sopenharmony_ciThe ``-p`` option allows users to configure server push.
7722c593315Sopenharmony_ci
7732c593315Sopenharmony_ciJust like ``nghttp``, it has a verbose output mode for framing
7742c593315Sopenharmony_ciinformation.  Here is sample output from ``nghttpd``:
7752c593315Sopenharmony_ci
7762c593315Sopenharmony_ci.. code-block:: text
7772c593315Sopenharmony_ci
7782c593315Sopenharmony_ci    $ nghttpd --no-tls -v 8080
7792c593315Sopenharmony_ci    IPv4: listen 0.0.0.0:8080
7802c593315Sopenharmony_ci    IPv6: listen :::8080
7812c593315Sopenharmony_ci    [id=1] [  1.521] send SETTINGS frame <length=6, flags=0x00, stream_id=0>
7822c593315Sopenharmony_ci              (niv=1)
7832c593315Sopenharmony_ci              [SETTINGS_MAX_CONCURRENT_STREAMS(0x03):100]
7842c593315Sopenharmony_ci    [id=1] [  1.521] recv SETTINGS frame <length=12, flags=0x00, stream_id=0>
7852c593315Sopenharmony_ci              (niv=2)
7862c593315Sopenharmony_ci              [SETTINGS_MAX_CONCURRENT_STREAMS(0x03):100]
7872c593315Sopenharmony_ci              [SETTINGS_INITIAL_WINDOW_SIZE(0x04):65535]
7882c593315Sopenharmony_ci    [id=1] [  1.521] recv SETTINGS frame <length=0, flags=0x01, stream_id=0>
7892c593315Sopenharmony_ci              ; ACK
7902c593315Sopenharmony_ci              (niv=0)
7912c593315Sopenharmony_ci    [id=1] [  1.521] recv PRIORITY frame <length=5, flags=0x00, stream_id=3>
7922c593315Sopenharmony_ci              (dep_stream_id=0, weight=201, exclusive=0)
7932c593315Sopenharmony_ci    [id=1] [  1.521] recv PRIORITY frame <length=5, flags=0x00, stream_id=5>
7942c593315Sopenharmony_ci              (dep_stream_id=0, weight=101, exclusive=0)
7952c593315Sopenharmony_ci    [id=1] [  1.521] recv PRIORITY frame <length=5, flags=0x00, stream_id=7>
7962c593315Sopenharmony_ci              (dep_stream_id=0, weight=1, exclusive=0)
7972c593315Sopenharmony_ci    [id=1] [  1.521] recv PRIORITY frame <length=5, flags=0x00, stream_id=9>
7982c593315Sopenharmony_ci              (dep_stream_id=7, weight=1, exclusive=0)
7992c593315Sopenharmony_ci    [id=1] [  1.521] recv PRIORITY frame <length=5, flags=0x00, stream_id=11>
8002c593315Sopenharmony_ci              (dep_stream_id=3, weight=1, exclusive=0)
8012c593315Sopenharmony_ci    [id=1] [  1.521] recv (stream_id=13) :method: GET
8022c593315Sopenharmony_ci    [id=1] [  1.521] recv (stream_id=13) :path: /
8032c593315Sopenharmony_ci    [id=1] [  1.521] recv (stream_id=13) :scheme: http
8042c593315Sopenharmony_ci    [id=1] [  1.521] recv (stream_id=13) :authority: localhost:8080
8052c593315Sopenharmony_ci    [id=1] [  1.521] recv (stream_id=13) accept: */*
8062c593315Sopenharmony_ci    [id=1] [  1.521] recv (stream_id=13) accept-encoding: gzip, deflate
8072c593315Sopenharmony_ci    [id=1] [  1.521] recv (stream_id=13) user-agent: nghttp2/1.0.0-DEV
8082c593315Sopenharmony_ci    [id=1] [  1.521] recv HEADERS frame <length=41, flags=0x25, stream_id=13>
8092c593315Sopenharmony_ci              ; END_STREAM | END_HEADERS | PRIORITY
8102c593315Sopenharmony_ci              (padlen=0, dep_stream_id=11, weight=16, exclusive=0)
8112c593315Sopenharmony_ci              ; Open new stream
8122c593315Sopenharmony_ci    [id=1] [  1.521] send SETTINGS frame <length=0, flags=0x01, stream_id=0>
8132c593315Sopenharmony_ci              ; ACK
8142c593315Sopenharmony_ci              (niv=0)
8152c593315Sopenharmony_ci    [id=1] [  1.521] send HEADERS frame <length=86, flags=0x04, stream_id=13>
8162c593315Sopenharmony_ci              ; END_HEADERS
8172c593315Sopenharmony_ci              (padlen=0)
8182c593315Sopenharmony_ci              ; First response header
8192c593315Sopenharmony_ci              :status: 200
8202c593315Sopenharmony_ci              server: nghttpd nghttp2/1.0.0-DEV
8212c593315Sopenharmony_ci              content-length: 10
8222c593315Sopenharmony_ci              cache-control: max-age=3600
8232c593315Sopenharmony_ci              date: Fri, 15 May 2015 14:49:04 GMT
8242c593315Sopenharmony_ci              last-modified: Tue, 30 Sep 2014 12:40:52 GMT
8252c593315Sopenharmony_ci    [id=1] [  1.522] send DATA frame <length=10, flags=0x01, stream_id=13>
8262c593315Sopenharmony_ci              ; END_STREAM
8272c593315Sopenharmony_ci    [id=1] [  1.522] stream_id=13 closed
8282c593315Sopenharmony_ci    [id=1] [  1.522] recv GOAWAY frame <length=8, flags=0x00, stream_id=0>
8292c593315Sopenharmony_ci              (last_stream_id=0, error_code=NO_ERROR(0x00), opaque_data(0)=[])
8302c593315Sopenharmony_ci    [id=1] [  1.522] closed
8312c593315Sopenharmony_ci
8322c593315Sopenharmony_cinghttpx - proxy
8332c593315Sopenharmony_ci+++++++++++++++
8342c593315Sopenharmony_ci
8352c593315Sopenharmony_ci``nghttpx`` is a multi-threaded reverse proxy for HTTP/3, HTTP/2, and
8362c593315Sopenharmony_ciHTTP/1.1, and powers http://nghttp2.org and supports HTTP/2 server
8372c593315Sopenharmony_cipush.
8382c593315Sopenharmony_ci
8392c593315Sopenharmony_ciWe reworked ``nghttpx`` command-line interface, and as a result, there
8402c593315Sopenharmony_ciare several incompatibles from 1.8.0 or earlier.  This is necessary to
8412c593315Sopenharmony_ciextend its capability, and secure the further feature enhancements in
8422c593315Sopenharmony_cithe future release.  Please read `Migration from nghttpx v1.8.0 or
8432c593315Sopenharmony_ciearlier
8442c593315Sopenharmony_ci<https://nghttp2.org/documentation/nghttpx-howto.html#migration-from-nghttpx-v1-8-0-or-earlier>`_
8452c593315Sopenharmony_cito know how to migrate from earlier releases.
8462c593315Sopenharmony_ci
8472c593315Sopenharmony_ci``nghttpx`` implements `important performance-oriented features
8482c593315Sopenharmony_ci<https://istlsfastyet.com/#server-performance>`_ in TLS, such as
8492c593315Sopenharmony_cisession IDs, session tickets (with automatic key rotation), OCSP
8502c593315Sopenharmony_cistapling, dynamic record sizing, ALPN/NPN, forward secrecy and HTTP/2.
8512c593315Sopenharmony_ci``nghttpx`` also offers the functionality to share session cache and
8522c593315Sopenharmony_citicket keys among multiple ``nghttpx`` instances via memcached.
8532c593315Sopenharmony_ci
8542c593315Sopenharmony_ci``nghttpx`` has 2 operation modes:
8552c593315Sopenharmony_ci
8562c593315Sopenharmony_ci================== ======================== ================ =============
8572c593315Sopenharmony_ciMode option        Frontend                 Backend          Note
8582c593315Sopenharmony_ci================== ======================== ================ =============
8592c593315Sopenharmony_cidefault mode       HTTP/3, HTTP/2, HTTP/1.1 HTTP/1.1, HTTP/2 Reverse proxy
8602c593315Sopenharmony_ci``--http2-proxy``  HTTP/3, HTTP/2, HTTP/1.1 HTTP/1.1, HTTP/2 Forward proxy
8612c593315Sopenharmony_ci================== ======================== ================ =============
8622c593315Sopenharmony_ci
8632c593315Sopenharmony_ciThe interesting mode at the moment is the default mode.  It works like
8642c593315Sopenharmony_cia reverse proxy and listens for HTTP/3, HTTP/2, and HTTP/1.1 and can
8652c593315Sopenharmony_cibe deployed as a SSL/TLS terminator for existing web server.
8662c593315Sopenharmony_ci
8672c593315Sopenharmony_ciIn all modes, the frontend connections are encrypted by SSL/TLS by
8682c593315Sopenharmony_cidefault.  To disable encryption, use the ``no-tls`` keyword in
8692c593315Sopenharmony_ci``--frontend`` option.  If encryption is disabled, incoming HTTP/1.1
8702c593315Sopenharmony_ciconnections can be upgraded to HTTP/2 through HTTP Upgrade.  On the
8712c593315Sopenharmony_ciother hard, backend connections are not encrypted by default.  To
8722c593315Sopenharmony_ciencrypt backend connections, use ``tls`` keyword in ``--backend``
8732c593315Sopenharmony_cioption.
8742c593315Sopenharmony_ci
8752c593315Sopenharmony_ci``nghttpx`` supports a configuration file.  See the ``--conf`` option and
8762c593315Sopenharmony_cisample configuration file ``nghttpx.conf.sample``.
8772c593315Sopenharmony_ci
8782c593315Sopenharmony_ciIn the default mode, ``nghttpx`` works as reverse proxy to the backend
8792c593315Sopenharmony_ciserver:
8802c593315Sopenharmony_ci
8812c593315Sopenharmony_ci.. code-block:: text
8822c593315Sopenharmony_ci
8832c593315Sopenharmony_ci    Client <-- (HTTP/3, HTTP/2, HTTP/1.1) --> nghttpx <-- (HTTP/1.1, HTTP/2) --> Web Server
8842c593315Sopenharmony_ci                                            [reverse proxy]
8852c593315Sopenharmony_ci
8862c593315Sopenharmony_ciWith the ``--http2-proxy`` option, it works as forward proxy, and it
8872c593315Sopenharmony_ciis so called secure HTTP/2 proxy:
8882c593315Sopenharmony_ci
8892c593315Sopenharmony_ci.. code-block:: text
8902c593315Sopenharmony_ci
8912c593315Sopenharmony_ci    Client <-- (HTTP/3, HTTP/2, HTTP/1.1) --> nghttpx <-- (HTTP/1.1) --> Proxy
8922c593315Sopenharmony_ci                                             [secure proxy]          (e.g., Squid, ATS)
8932c593315Sopenharmony_ci
8942c593315Sopenharmony_ciThe ``Client`` in the above example needs to be configured to use
8952c593315Sopenharmony_ci``nghttpx`` as secure proxy.
8962c593315Sopenharmony_ci
8972c593315Sopenharmony_ciAt the time of this writing, both Chrome and Firefox support secure
8982c593315Sopenharmony_ciHTTP/2 proxy.  One way to configure Chrome to use a secure proxy is to
8992c593315Sopenharmony_cicreate a proxy.pac script like this:
9002c593315Sopenharmony_ci
9012c593315Sopenharmony_ci.. code-block:: javascript
9022c593315Sopenharmony_ci
9032c593315Sopenharmony_ci    function FindProxyForURL(url, host) {
9042c593315Sopenharmony_ci        return "HTTPS SERVERADDR:PORT";
9052c593315Sopenharmony_ci    }
9062c593315Sopenharmony_ci
9072c593315Sopenharmony_ci``SERVERADDR`` and ``PORT`` is the hostname/address and port of the
9082c593315Sopenharmony_cimachine nghttpx is running on.  Please note that Chrome requires a valid
9092c593315Sopenharmony_cicertificate for secure proxy.
9102c593315Sopenharmony_ci
9112c593315Sopenharmony_ciThen run Chrome with the following arguments:
9122c593315Sopenharmony_ci
9132c593315Sopenharmony_ci.. code-block:: text
9142c593315Sopenharmony_ci
9152c593315Sopenharmony_ci    $ google-chrome --proxy-pac-url=file:///path/to/proxy.pac --use-npn
9162c593315Sopenharmony_ci
9172c593315Sopenharmony_ciThe backend HTTP/2 connections can be tunneled through an HTTP proxy.
9182c593315Sopenharmony_ciThe proxy is specified using ``--backend-http-proxy-uri``.  The
9192c593315Sopenharmony_cifollowing figure illustrates how nghttpx talks to the outside HTTP/2
9202c593315Sopenharmony_ciproxy through an HTTP proxy:
9212c593315Sopenharmony_ci
9222c593315Sopenharmony_ci.. code-block:: text
9232c593315Sopenharmony_ci
9242c593315Sopenharmony_ci    Client <-- (HTTP/3, HTTP/2, HTTP/1.1) --> nghttpx <-- (HTTP/2) --
9252c593315Sopenharmony_ci
9262c593315Sopenharmony_ci            --===================---> HTTP/2 Proxy
9272c593315Sopenharmony_ci              (HTTP proxy tunnel)     (e.g., nghttpx -s)
9282c593315Sopenharmony_ci
9292c593315Sopenharmony_ciBenchmarking tool
9302c593315Sopenharmony_ci-----------------
9312c593315Sopenharmony_ci
9322c593315Sopenharmony_ciThe ``h2load`` program is a benchmarking tool for HTTP/3, HTTP/2, and
9332c593315Sopenharmony_ciHTTP/1.1.  The UI of ``h2load`` is heavily inspired by ``weighttp``
9342c593315Sopenharmony_ci(https://github.com/lighttpd/weighttp).  The typical usage is as
9352c593315Sopenharmony_cifollows:
9362c593315Sopenharmony_ci
9372c593315Sopenharmony_ci.. code-block:: text
9382c593315Sopenharmony_ci
9392c593315Sopenharmony_ci    $ h2load -n100000 -c100 -m100 https://localhost:8443/
9402c593315Sopenharmony_ci    starting benchmark...
9412c593315Sopenharmony_ci    spawning thread #0: 100 concurrent clients, 100000 total requests
9422c593315Sopenharmony_ci    Protocol: TLSv1.2
9432c593315Sopenharmony_ci    Cipher: ECDHE-RSA-AES128-GCM-SHA256
9442c593315Sopenharmony_ci    Server Temp Key: ECDH P-256 256 bits
9452c593315Sopenharmony_ci    progress: 10% done
9462c593315Sopenharmony_ci    progress: 20% done
9472c593315Sopenharmony_ci    progress: 30% done
9482c593315Sopenharmony_ci    progress: 40% done
9492c593315Sopenharmony_ci    progress: 50% done
9502c593315Sopenharmony_ci    progress: 60% done
9512c593315Sopenharmony_ci    progress: 70% done
9522c593315Sopenharmony_ci    progress: 80% done
9532c593315Sopenharmony_ci    progress: 90% done
9542c593315Sopenharmony_ci    progress: 100% done
9552c593315Sopenharmony_ci
9562c593315Sopenharmony_ci    finished in 771.26ms, 129658 req/s, 4.71MB/s
9572c593315Sopenharmony_ci    requests: 100000 total, 100000 started, 100000 done, 100000 succeeded, 0 failed, 0 errored
9582c593315Sopenharmony_ci    status codes: 100000 2xx, 0 3xx, 0 4xx, 0 5xx
9592c593315Sopenharmony_ci    traffic: 3812300 bytes total, 1009900 bytes headers, 1000000 bytes data
9602c593315Sopenharmony_ci                         min         max         mean         sd        +/- sd
9612c593315Sopenharmony_ci    time for request:    25.12ms    124.55ms     51.07ms     15.36ms    84.87%
9622c593315Sopenharmony_ci    time for connect:   208.94ms    254.67ms    241.38ms      7.95ms    63.00%
9632c593315Sopenharmony_ci    time to 1st byte:   209.11ms    254.80ms    241.51ms      7.94ms    63.00%
9642c593315Sopenharmony_ci
9652c593315Sopenharmony_ciThe above example issued total 100,000 requests, using 100 concurrent
9662c593315Sopenharmony_ciclients (in other words, 100 HTTP/2 sessions), and a maximum of 100 streams
9672c593315Sopenharmony_ciper client.  With the ``-t`` option, ``h2load`` will use multiple native
9682c593315Sopenharmony_cithreads to avoid saturating a single core on client side.
9692c593315Sopenharmony_ci
9702c593315Sopenharmony_ci.. warning::
9712c593315Sopenharmony_ci
9722c593315Sopenharmony_ci   **Don't use this tool against publicly available servers.** That is
9732c593315Sopenharmony_ci   considered a DOS attack.  Please only use it against your private
9742c593315Sopenharmony_ci   servers.
9752c593315Sopenharmony_ci
9762c593315Sopenharmony_ciIf the experimental HTTP/3 is enabled, h2load can send requests to
9772c593315Sopenharmony_ciHTTP/3 server.  To do this, specify ``h3`` to ``--npn-list`` option
9782c593315Sopenharmony_cilike so:
9792c593315Sopenharmony_ci
9802c593315Sopenharmony_ci.. code-block:: text
9812c593315Sopenharmony_ci
9822c593315Sopenharmony_ci    $ h2load --npn-list h3 https://127.0.0.1:4433
9832c593315Sopenharmony_ci
9842c593315Sopenharmony_ciHPACK tools
9852c593315Sopenharmony_ci-----------
9862c593315Sopenharmony_ci
9872c593315Sopenharmony_ciThe ``src`` directory contains the HPACK tools.  The ``deflatehd`` program is a
9882c593315Sopenharmony_cicommand-line header compression tool.  The ``inflatehd`` program is a
9892c593315Sopenharmony_cicommand-line header decompression tool.  Both tools read input from
9902c593315Sopenharmony_cistdin and write output to stdout.  Errors are written to stderr.
9912c593315Sopenharmony_ciThey take JSON as input and output.  We  (mostly) use the same JSON data
9922c593315Sopenharmony_ciformat described at https://github.com/http2jp/hpack-test-case.
9932c593315Sopenharmony_ci
9942c593315Sopenharmony_cideflatehd - header compressor
9952c593315Sopenharmony_ci+++++++++++++++++++++++++++++
9962c593315Sopenharmony_ci
9972c593315Sopenharmony_ciThe ``deflatehd`` program reads JSON data or HTTP/1-style header fields from
9982c593315Sopenharmony_cistdin and outputs compressed header block in JSON.
9992c593315Sopenharmony_ci
10002c593315Sopenharmony_ciFor the JSON input, the root JSON object must include a ``cases`` key.
10012c593315Sopenharmony_ciIts value has to include the sequence of input header set.  They share
10022c593315Sopenharmony_cithe same compression context and are processed in the order they
10032c593315Sopenharmony_ciappear.  Each item in the sequence is a JSON object and it must
10042c593315Sopenharmony_ciinclude a ``headers`` key.  Its value is an array of JSON objects,
10052c593315Sopenharmony_ciwhich includes exactly one name/value pair.
10062c593315Sopenharmony_ci
10072c593315Sopenharmony_ciExample:
10082c593315Sopenharmony_ci
10092c593315Sopenharmony_ci.. code-block:: json
10102c593315Sopenharmony_ci
10112c593315Sopenharmony_ci    {
10122c593315Sopenharmony_ci      "cases":
10132c593315Sopenharmony_ci      [
10142c593315Sopenharmony_ci        {
10152c593315Sopenharmony_ci          "headers": [
10162c593315Sopenharmony_ci            { ":method": "GET" },
10172c593315Sopenharmony_ci            { ":path": "/" }
10182c593315Sopenharmony_ci          ]
10192c593315Sopenharmony_ci        },
10202c593315Sopenharmony_ci        {
10212c593315Sopenharmony_ci          "headers": [
10222c593315Sopenharmony_ci            { ":method": "POST" },
10232c593315Sopenharmony_ci            { ":path": "/" }
10242c593315Sopenharmony_ci          ]
10252c593315Sopenharmony_ci        }
10262c593315Sopenharmony_ci      ]
10272c593315Sopenharmony_ci    }
10282c593315Sopenharmony_ci
10292c593315Sopenharmony_ci
10302c593315Sopenharmony_ciWith the ``-t`` option, the program can accept more familiar HTTP/1 style
10312c593315Sopenharmony_ciheader field blocks.  Each header set is delimited by an empty line:
10322c593315Sopenharmony_ci
10332c593315Sopenharmony_ciExample:
10342c593315Sopenharmony_ci
10352c593315Sopenharmony_ci.. code-block:: text
10362c593315Sopenharmony_ci
10372c593315Sopenharmony_ci    :method: GET
10382c593315Sopenharmony_ci    :scheme: https
10392c593315Sopenharmony_ci    :path: /
10402c593315Sopenharmony_ci
10412c593315Sopenharmony_ci    :method: POST
10422c593315Sopenharmony_ci    user-agent: nghttp2
10432c593315Sopenharmony_ci
10442c593315Sopenharmony_ciThe output is in JSON object.  It should include a ``cases`` key and its
10452c593315Sopenharmony_civalue is an array of JSON objects, which has at least the following keys:
10462c593315Sopenharmony_ci
10472c593315Sopenharmony_ciseq
10482c593315Sopenharmony_ci    The index of header set in the input.
10492c593315Sopenharmony_ci
10502c593315Sopenharmony_ciinput_length
10512c593315Sopenharmony_ci    The sum of the length of the name/value pairs in the input.
10522c593315Sopenharmony_ci
10532c593315Sopenharmony_cioutput_length
10542c593315Sopenharmony_ci    The length of the compressed header block.
10552c593315Sopenharmony_ci
10562c593315Sopenharmony_cipercentage_of_original_size
10572c593315Sopenharmony_ci    ``output_length`` / ``input_length`` * 100
10582c593315Sopenharmony_ci
10592c593315Sopenharmony_ciwire
10602c593315Sopenharmony_ci    The compressed header block as a hex string.
10612c593315Sopenharmony_ci
10622c593315Sopenharmony_ciheaders
10632c593315Sopenharmony_ci    The input header set.
10642c593315Sopenharmony_ci
10652c593315Sopenharmony_ciheader_table_size
10662c593315Sopenharmony_ci    The header table size adjusted before deflating the header set.
10672c593315Sopenharmony_ci
10682c593315Sopenharmony_ciExamples:
10692c593315Sopenharmony_ci
10702c593315Sopenharmony_ci.. code-block:: json
10712c593315Sopenharmony_ci
10722c593315Sopenharmony_ci    {
10732c593315Sopenharmony_ci      "cases":
10742c593315Sopenharmony_ci      [
10752c593315Sopenharmony_ci        {
10762c593315Sopenharmony_ci          "seq": 0,
10772c593315Sopenharmony_ci          "input_length": 66,
10782c593315Sopenharmony_ci          "output_length": 20,
10792c593315Sopenharmony_ci          "percentage_of_original_size": 30.303030303030305,
10802c593315Sopenharmony_ci          "wire": "01881f3468e5891afcbf83868a3d856659c62e3f",
10812c593315Sopenharmony_ci          "headers": [
10822c593315Sopenharmony_ci            {
10832c593315Sopenharmony_ci              ":authority": "example.org"
10842c593315Sopenharmony_ci            },
10852c593315Sopenharmony_ci            {
10862c593315Sopenharmony_ci              ":method": "GET"
10872c593315Sopenharmony_ci            },
10882c593315Sopenharmony_ci            {
10892c593315Sopenharmony_ci              ":path": "/"
10902c593315Sopenharmony_ci            },
10912c593315Sopenharmony_ci            {
10922c593315Sopenharmony_ci              ":scheme": "https"
10932c593315Sopenharmony_ci            },
10942c593315Sopenharmony_ci            {
10952c593315Sopenharmony_ci              "user-agent": "nghttp2"
10962c593315Sopenharmony_ci            }
10972c593315Sopenharmony_ci          ],
10982c593315Sopenharmony_ci          "header_table_size": 4096
10992c593315Sopenharmony_ci        }
11002c593315Sopenharmony_ci        ,
11012c593315Sopenharmony_ci        {
11022c593315Sopenharmony_ci          "seq": 1,
11032c593315Sopenharmony_ci          "input_length": 74,
11042c593315Sopenharmony_ci          "output_length": 10,
11052c593315Sopenharmony_ci          "percentage_of_original_size": 13.513513513513514,
11062c593315Sopenharmony_ci          "wire": "88448504252dd5918485",
11072c593315Sopenharmony_ci          "headers": [
11082c593315Sopenharmony_ci            {
11092c593315Sopenharmony_ci              ":authority": "example.org"
11102c593315Sopenharmony_ci            },
11112c593315Sopenharmony_ci            {
11122c593315Sopenharmony_ci              ":method": "POST"
11132c593315Sopenharmony_ci            },
11142c593315Sopenharmony_ci            {
11152c593315Sopenharmony_ci              ":path": "/account"
11162c593315Sopenharmony_ci            },
11172c593315Sopenharmony_ci            {
11182c593315Sopenharmony_ci              ":scheme": "https"
11192c593315Sopenharmony_ci            },
11202c593315Sopenharmony_ci            {
11212c593315Sopenharmony_ci              "user-agent": "nghttp2"
11222c593315Sopenharmony_ci            }
11232c593315Sopenharmony_ci          ],
11242c593315Sopenharmony_ci          "header_table_size": 4096
11252c593315Sopenharmony_ci        }
11262c593315Sopenharmony_ci      ]
11272c593315Sopenharmony_ci    }
11282c593315Sopenharmony_ci
11292c593315Sopenharmony_ci
11302c593315Sopenharmony_ciThe output can be used as the input for ``inflatehd`` and
11312c593315Sopenharmony_ci``deflatehd``.
11322c593315Sopenharmony_ci
11332c593315Sopenharmony_ciWith the ``-d`` option, the extra ``header_table`` key is added and its
11342c593315Sopenharmony_ciassociated value includes the state of dynamic header table after the
11352c593315Sopenharmony_cicorresponding header set was processed.  The value includes at least
11362c593315Sopenharmony_cithe following keys:
11372c593315Sopenharmony_ci
11382c593315Sopenharmony_cientries
11392c593315Sopenharmony_ci    The entry in the header table.  If ``referenced`` is ``true``, it
11402c593315Sopenharmony_ci    is in the reference set.  The ``size`` includes the overhead (32
11412c593315Sopenharmony_ci    bytes).  The ``index`` corresponds to the index of header table.
11422c593315Sopenharmony_ci    The ``name`` is the header field name and the ``value`` is the
11432c593315Sopenharmony_ci    header field value.
11442c593315Sopenharmony_ci
11452c593315Sopenharmony_cisize
11462c593315Sopenharmony_ci    The sum of the spaces entries occupied, this includes the
11472c593315Sopenharmony_ci    entry overhead.
11482c593315Sopenharmony_ci
11492c593315Sopenharmony_cimax_size
11502c593315Sopenharmony_ci    The maximum header table size.
11512c593315Sopenharmony_ci
11522c593315Sopenharmony_cideflate_size
11532c593315Sopenharmony_ci    The sum of the spaces entries occupied within
11542c593315Sopenharmony_ci    ``max_deflate_size``.
11552c593315Sopenharmony_ci
11562c593315Sopenharmony_cimax_deflate_size
11572c593315Sopenharmony_ci    The maximum header table size the encoder uses.  This can be smaller
11582c593315Sopenharmony_ci    than ``max_size``.  In this case, the encoder only uses up to first
11592c593315Sopenharmony_ci    ``max_deflate_size`` buffer.  Since the header table size is still
11602c593315Sopenharmony_ci    ``max_size``, the encoder has to keep track of entries outside the
11612c593315Sopenharmony_ci    ``max_deflate_size`` but inside the ``max_size`` and make sure
11622c593315Sopenharmony_ci    that they are no longer referenced.
11632c593315Sopenharmony_ci
11642c593315Sopenharmony_ciExample:
11652c593315Sopenharmony_ci
11662c593315Sopenharmony_ci.. code-block:: json
11672c593315Sopenharmony_ci
11682c593315Sopenharmony_ci    {
11692c593315Sopenharmony_ci      "cases":
11702c593315Sopenharmony_ci      [
11712c593315Sopenharmony_ci        {
11722c593315Sopenharmony_ci          "seq": 0,
11732c593315Sopenharmony_ci          "input_length": 66,
11742c593315Sopenharmony_ci          "output_length": 20,
11752c593315Sopenharmony_ci          "percentage_of_original_size": 30.303030303030305,
11762c593315Sopenharmony_ci          "wire": "01881f3468e5891afcbf83868a3d856659c62e3f",
11772c593315Sopenharmony_ci          "headers": [
11782c593315Sopenharmony_ci            {
11792c593315Sopenharmony_ci              ":authority": "example.org"
11802c593315Sopenharmony_ci            },
11812c593315Sopenharmony_ci            {
11822c593315Sopenharmony_ci              ":method": "GET"
11832c593315Sopenharmony_ci            },
11842c593315Sopenharmony_ci            {
11852c593315Sopenharmony_ci              ":path": "/"
11862c593315Sopenharmony_ci            },
11872c593315Sopenharmony_ci            {
11882c593315Sopenharmony_ci              ":scheme": "https"
11892c593315Sopenharmony_ci            },
11902c593315Sopenharmony_ci            {
11912c593315Sopenharmony_ci              "user-agent": "nghttp2"
11922c593315Sopenharmony_ci            }
11932c593315Sopenharmony_ci          ],
11942c593315Sopenharmony_ci          "header_table_size": 4096,
11952c593315Sopenharmony_ci          "header_table": {
11962c593315Sopenharmony_ci            "entries": [
11972c593315Sopenharmony_ci              {
11982c593315Sopenharmony_ci                "index": 1,
11992c593315Sopenharmony_ci                "name": "user-agent",
12002c593315Sopenharmony_ci                "value": "nghttp2",
12012c593315Sopenharmony_ci                "referenced": true,
12022c593315Sopenharmony_ci                "size": 49
12032c593315Sopenharmony_ci              },
12042c593315Sopenharmony_ci              {
12052c593315Sopenharmony_ci                "index": 2,
12062c593315Sopenharmony_ci                "name": ":scheme",
12072c593315Sopenharmony_ci                "value": "https",
12082c593315Sopenharmony_ci                "referenced": true,
12092c593315Sopenharmony_ci                "size": 44
12102c593315Sopenharmony_ci              },
12112c593315Sopenharmony_ci              {
12122c593315Sopenharmony_ci                "index": 3,
12132c593315Sopenharmony_ci                "name": ":path",
12142c593315Sopenharmony_ci                "value": "/",
12152c593315Sopenharmony_ci                "referenced": true,
12162c593315Sopenharmony_ci                "size": 38
12172c593315Sopenharmony_ci              },
12182c593315Sopenharmony_ci              {
12192c593315Sopenharmony_ci                "index": 4,
12202c593315Sopenharmony_ci                "name": ":method",
12212c593315Sopenharmony_ci                "value": "GET",
12222c593315Sopenharmony_ci                "referenced": true,
12232c593315Sopenharmony_ci                "size": 42
12242c593315Sopenharmony_ci              },
12252c593315Sopenharmony_ci              {
12262c593315Sopenharmony_ci                "index": 5,
12272c593315Sopenharmony_ci                "name": ":authority",
12282c593315Sopenharmony_ci                "value": "example.org",
12292c593315Sopenharmony_ci                "referenced": true,
12302c593315Sopenharmony_ci                "size": 53
12312c593315Sopenharmony_ci              }
12322c593315Sopenharmony_ci            ],
12332c593315Sopenharmony_ci            "size": 226,
12342c593315Sopenharmony_ci            "max_size": 4096,
12352c593315Sopenharmony_ci            "deflate_size": 226,
12362c593315Sopenharmony_ci            "max_deflate_size": 4096
12372c593315Sopenharmony_ci          }
12382c593315Sopenharmony_ci        }
12392c593315Sopenharmony_ci        ,
12402c593315Sopenharmony_ci        {
12412c593315Sopenharmony_ci          "seq": 1,
12422c593315Sopenharmony_ci          "input_length": 74,
12432c593315Sopenharmony_ci          "output_length": 10,
12442c593315Sopenharmony_ci          "percentage_of_original_size": 13.513513513513514,
12452c593315Sopenharmony_ci          "wire": "88448504252dd5918485",
12462c593315Sopenharmony_ci          "headers": [
12472c593315Sopenharmony_ci            {
12482c593315Sopenharmony_ci              ":authority": "example.org"
12492c593315Sopenharmony_ci            },
12502c593315Sopenharmony_ci            {
12512c593315Sopenharmony_ci              ":method": "POST"
12522c593315Sopenharmony_ci            },
12532c593315Sopenharmony_ci            {
12542c593315Sopenharmony_ci              ":path": "/account"
12552c593315Sopenharmony_ci            },
12562c593315Sopenharmony_ci            {
12572c593315Sopenharmony_ci              ":scheme": "https"
12582c593315Sopenharmony_ci            },
12592c593315Sopenharmony_ci            {
12602c593315Sopenharmony_ci              "user-agent": "nghttp2"
12612c593315Sopenharmony_ci            }
12622c593315Sopenharmony_ci          ],
12632c593315Sopenharmony_ci          "header_table_size": 4096,
12642c593315Sopenharmony_ci          "header_table": {
12652c593315Sopenharmony_ci            "entries": [
12662c593315Sopenharmony_ci              {
12672c593315Sopenharmony_ci                "index": 1,
12682c593315Sopenharmony_ci                "name": ":method",
12692c593315Sopenharmony_ci                "value": "POST",
12702c593315Sopenharmony_ci                "referenced": true,
12712c593315Sopenharmony_ci                "size": 43
12722c593315Sopenharmony_ci              },
12732c593315Sopenharmony_ci              {
12742c593315Sopenharmony_ci                "index": 2,
12752c593315Sopenharmony_ci                "name": "user-agent",
12762c593315Sopenharmony_ci                "value": "nghttp2",
12772c593315Sopenharmony_ci                "referenced": true,
12782c593315Sopenharmony_ci                "size": 49
12792c593315Sopenharmony_ci              },
12802c593315Sopenharmony_ci              {
12812c593315Sopenharmony_ci                "index": 3,
12822c593315Sopenharmony_ci                "name": ":scheme",
12832c593315Sopenharmony_ci                "value": "https",
12842c593315Sopenharmony_ci                "referenced": true,
12852c593315Sopenharmony_ci                "size": 44
12862c593315Sopenharmony_ci              },
12872c593315Sopenharmony_ci              {
12882c593315Sopenharmony_ci                "index": 4,
12892c593315Sopenharmony_ci                "name": ":path",
12902c593315Sopenharmony_ci                "value": "/",
12912c593315Sopenharmony_ci                "referenced": false,
12922c593315Sopenharmony_ci                "size": 38
12932c593315Sopenharmony_ci              },
12942c593315Sopenharmony_ci              {
12952c593315Sopenharmony_ci                "index": 5,
12962c593315Sopenharmony_ci                "name": ":method",
12972c593315Sopenharmony_ci                "value": "GET",
12982c593315Sopenharmony_ci                "referenced": false,
12992c593315Sopenharmony_ci                "size": 42
13002c593315Sopenharmony_ci              },
13012c593315Sopenharmony_ci              {
13022c593315Sopenharmony_ci                "index": 6,
13032c593315Sopenharmony_ci                "name": ":authority",
13042c593315Sopenharmony_ci                "value": "example.org",
13052c593315Sopenharmony_ci                "referenced": true,
13062c593315Sopenharmony_ci                "size": 53
13072c593315Sopenharmony_ci              }
13082c593315Sopenharmony_ci            ],
13092c593315Sopenharmony_ci            "size": 269,
13102c593315Sopenharmony_ci            "max_size": 4096,
13112c593315Sopenharmony_ci            "deflate_size": 269,
13122c593315Sopenharmony_ci            "max_deflate_size": 4096
13132c593315Sopenharmony_ci          }
13142c593315Sopenharmony_ci        }
13152c593315Sopenharmony_ci      ]
13162c593315Sopenharmony_ci    }
13172c593315Sopenharmony_ci
13182c593315Sopenharmony_ciinflatehd - header decompressor
13192c593315Sopenharmony_ci+++++++++++++++++++++++++++++++
13202c593315Sopenharmony_ci
13212c593315Sopenharmony_ciThe ``inflatehd`` program reads JSON data from stdin and outputs decompressed
13222c593315Sopenharmony_ciname/value pairs in JSON.
13232c593315Sopenharmony_ci
13242c593315Sopenharmony_ciThe root JSON object must include the ``cases`` key.  Its value has to
13252c593315Sopenharmony_ciinclude the sequence of compressed header blocks.  They share the same
13262c593315Sopenharmony_cicompression context and are processed in the order they appear.  Each
13272c593315Sopenharmony_ciitem in the sequence is a JSON object and it must have at least a
13282c593315Sopenharmony_ci``wire`` key.  Its value is a compressed header block as a hex string.
13292c593315Sopenharmony_ci
13302c593315Sopenharmony_ciExample:
13312c593315Sopenharmony_ci
13322c593315Sopenharmony_ci.. code-block:: json
13332c593315Sopenharmony_ci
13342c593315Sopenharmony_ci    {
13352c593315Sopenharmony_ci      "cases":
13362c593315Sopenharmony_ci      [
13372c593315Sopenharmony_ci        { "wire": "8285" },
13382c593315Sopenharmony_ci        { "wire": "8583" }
13392c593315Sopenharmony_ci      ]
13402c593315Sopenharmony_ci    }
13412c593315Sopenharmony_ci
13422c593315Sopenharmony_ciThe output is a JSON object.  It should include a ``cases`` key and its
13432c593315Sopenharmony_civalue is an array of JSON objects, which has at least following keys:
13442c593315Sopenharmony_ci
13452c593315Sopenharmony_ciseq
13462c593315Sopenharmony_ci    The index of the header set in the input.
13472c593315Sopenharmony_ci
13482c593315Sopenharmony_ciheaders
13492c593315Sopenharmony_ci    A JSON array that includes decompressed name/value pairs.
13502c593315Sopenharmony_ci
13512c593315Sopenharmony_ciwire
13522c593315Sopenharmony_ci    The compressed header block as a hex string.
13532c593315Sopenharmony_ci
13542c593315Sopenharmony_ciheader_table_size
13552c593315Sopenharmony_ci    The header table size adjusted before inflating compressed header
13562c593315Sopenharmony_ci    block.
13572c593315Sopenharmony_ci
13582c593315Sopenharmony_ciExample:
13592c593315Sopenharmony_ci
13602c593315Sopenharmony_ci.. code-block:: json
13612c593315Sopenharmony_ci
13622c593315Sopenharmony_ci    {
13632c593315Sopenharmony_ci      "cases":
13642c593315Sopenharmony_ci      [
13652c593315Sopenharmony_ci        {
13662c593315Sopenharmony_ci          "seq": 0,
13672c593315Sopenharmony_ci          "wire": "01881f3468e5891afcbf83868a3d856659c62e3f",
13682c593315Sopenharmony_ci          "headers": [
13692c593315Sopenharmony_ci            {
13702c593315Sopenharmony_ci              ":authority": "example.org"
13712c593315Sopenharmony_ci            },
13722c593315Sopenharmony_ci            {
13732c593315Sopenharmony_ci              ":method": "GET"
13742c593315Sopenharmony_ci            },
13752c593315Sopenharmony_ci            {
13762c593315Sopenharmony_ci              ":path": "/"
13772c593315Sopenharmony_ci            },
13782c593315Sopenharmony_ci            {
13792c593315Sopenharmony_ci              ":scheme": "https"
13802c593315Sopenharmony_ci            },
13812c593315Sopenharmony_ci            {
13822c593315Sopenharmony_ci              "user-agent": "nghttp2"
13832c593315Sopenharmony_ci            }
13842c593315Sopenharmony_ci          ],
13852c593315Sopenharmony_ci          "header_table_size": 4096
13862c593315Sopenharmony_ci        }
13872c593315Sopenharmony_ci        ,
13882c593315Sopenharmony_ci        {
13892c593315Sopenharmony_ci          "seq": 1,
13902c593315Sopenharmony_ci          "wire": "88448504252dd5918485",
13912c593315Sopenharmony_ci          "headers": [
13922c593315Sopenharmony_ci            {
13932c593315Sopenharmony_ci              ":method": "POST"
13942c593315Sopenharmony_ci            },
13952c593315Sopenharmony_ci            {
13962c593315Sopenharmony_ci              ":path": "/account"
13972c593315Sopenharmony_ci            },
13982c593315Sopenharmony_ci            {
13992c593315Sopenharmony_ci              "user-agent": "nghttp2"
14002c593315Sopenharmony_ci            },
14012c593315Sopenharmony_ci            {
14022c593315Sopenharmony_ci              ":scheme": "https"
14032c593315Sopenharmony_ci            },
14042c593315Sopenharmony_ci            {
14052c593315Sopenharmony_ci              ":authority": "example.org"
14062c593315Sopenharmony_ci            }
14072c593315Sopenharmony_ci          ],
14082c593315Sopenharmony_ci          "header_table_size": 4096
14092c593315Sopenharmony_ci        }
14102c593315Sopenharmony_ci      ]
14112c593315Sopenharmony_ci    }
14122c593315Sopenharmony_ci
14132c593315Sopenharmony_ciThe output can be used as the input for ``deflatehd`` and
14142c593315Sopenharmony_ci``inflatehd``.
14152c593315Sopenharmony_ci
14162c593315Sopenharmony_ciWith the ``-d`` option, the extra ``header_table`` key is added and its
14172c593315Sopenharmony_ciassociated value includes the state of the dynamic header table after the
14182c593315Sopenharmony_cicorresponding header set was processed.  The format is the same as
14192c593315Sopenharmony_ci``deflatehd``.
14202c593315Sopenharmony_ci
14212c593315Sopenharmony_ciContribution
14222c593315Sopenharmony_ci------------
14232c593315Sopenharmony_ci
14242c593315Sopenharmony_ci[This text was composed based on 1.2. License section of curl/libcurl
14252c593315Sopenharmony_ciproject.]
14262c593315Sopenharmony_ci
14272c593315Sopenharmony_ciWhen contributing with code, you agree to put your changes and new
14282c593315Sopenharmony_cicode under the same license nghttp2 is already using unless stated and
14292c593315Sopenharmony_ciagreed otherwise.
14302c593315Sopenharmony_ci
14312c593315Sopenharmony_ciWhen changing existing source code, do not alter the copyright of
14322c593315Sopenharmony_cithe original file(s).  The copyright will still be owned by the
14332c593315Sopenharmony_cioriginal creator(s) or those who have been assigned copyright by the
14342c593315Sopenharmony_cioriginal author(s).
14352c593315Sopenharmony_ci
14362c593315Sopenharmony_ciBy submitting a patch to the nghttp2 project, you (or your employer, as
14372c593315Sopenharmony_cithe case may be) agree to assign the copyright of your submission to us.
14382c593315Sopenharmony_ci.. the above really needs to be reworded to pass legal muster.
14392c593315Sopenharmony_ciWe will credit you for your
14402c593315Sopenharmony_cichanges as far as possible, to give credit but also to keep a trace
14412c593315Sopenharmony_ciback to who made what changes.  Please always provide us with your
14422c593315Sopenharmony_cifull real name when contributing!
14432c593315Sopenharmony_ci
14442c593315Sopenharmony_ciSee `Contribution Guidelines
14452c593315Sopenharmony_ci<https://nghttp2.org/documentation/contribute.html>`_ for more
14462c593315Sopenharmony_cidetails.
14472c593315Sopenharmony_ci
14482c593315Sopenharmony_ciReporting vulnerability
14492c593315Sopenharmony_ci-----------------------
14502c593315Sopenharmony_ci
14512c593315Sopenharmony_ciIf you find a vulnerability in our software, please send the email to
14522c593315Sopenharmony_ci"tatsuhiro.t at gmail dot com" about its details instead of submitting
14532c593315Sopenharmony_ciissues on github issue page.  It is a standard practice not to
14542c593315Sopenharmony_cidisclose vulnerability information publicly until a fixed version is
14552c593315Sopenharmony_cireleased, or mitigation is worked out.
14562c593315Sopenharmony_ci
14572c593315Sopenharmony_ciIn the future, we may setup a dedicated mail address for this purpose.
14582c593315Sopenharmony_ci
14592c593315Sopenharmony_ciVersioning
14602c593315Sopenharmony_ci----------
14612c593315Sopenharmony_ci
14622c593315Sopenharmony_ciIn general, we follow `Semantic Versioning <http://semver.org/>`_.
14632c593315Sopenharmony_ci
14642c593315Sopenharmony_ciWe may release PATCH releases between the regular releases, mainly for
14652c593315Sopenharmony_cisevere security bug fixes.
14662c593315Sopenharmony_ci
14672c593315Sopenharmony_ciWe have no plan to break API compatibility changes involving soname
14682c593315Sopenharmony_cibump, so MAJOR version will stay 1 for the foreseeable future.
14692c593315Sopenharmony_ci
14702c593315Sopenharmony_ciLicense
14712c593315Sopenharmony_ci-------
14722c593315Sopenharmony_ci
14732c593315Sopenharmony_ciThe MIT License
1474