Lines Matching +full:ipv4 +full:- +full:no +full:- +full:config +full:- +full:for +full:- +full:cpp
1 nghttp2 - HTTP/2 C Library
9 proxy. We have also developed load test and benchmarking tools for
20 ------------------
23 HTTP/2 and `RFC 7541 <https://tools.ietf.org/html/rfc7541>`_ HPACK -
24 Header Compression for HTTP/2
27 (https://github.com/tatsuhiro-t/spdylay) project.
30 ------------------
37 This endpoint supports ``h2``, ``h2-16``, ``h2-14``, and
38 ``http/1.1`` via ALPN/NPN and requires TLSv1.2 for HTTP/2
46 ------------
50 * pkg-config >= 0.20
59 * sphinx (http://sphinx-doc.org/)
62 all you need. Use ``--enable-lib-only`` to ensure that only
73 * libc-ares >= 1.7.5
79 To enable ``-a`` option (getting linked assets from the downloaded
87 * libsystemd-dev >= 209
95 * libevent-openssl >= 2.0.8
109 * libboost-dev >= 1.54.0
110 * libboost-thread-dev >= 1.54.0
116 * python-setuptools
121 .. code-block:: text
123 sudo apt-get install g++ make binutils autoconf automake autotools-dev libtool pkg-config \
124 zlib1g-dev libcunit1-dev libssl-dev libxml2-dev libev-dev libevent-dev libjansson-dev \
125 libc-ares-dev libjemalloc-dev libsystemd-dev \
126 cython python3-dev python-setuptools
128 To enable mruby support for nghttpx, `mruby
131 mrgems, mruby is manged by git submodule under third-party/mruby
132 directory. Currently, mruby support for nghttpx is disabled by
133 default. To enable mruby support, use ``--with-mruby`` configure
134 option. Note that at the time of this writing, libmruby-dev and mruby
135 packages in Debian/Ubuntu are not usable for nghttp2, since they do
143 privilege separation engine for OpenSSL / LibreSSL. In short, it
146 enable it, use ``--with-neverbleed`` configure option.
155 To enable mruby support in nghttpx, and use ``--with-mruby``
160 Mac OS X users may need the ``--disable-threads`` configure option to
161 disable multi-threading in nghttpd, nghttpx and h2load to prevent
168 and h2load), you must use the ``--enable-app`` configure option and
171 applications, and enable ``--enable-app`` automatically, so you
173 applications were not built, then using ``--enable-app`` may find
178 In order to detect third party libraries, pkg-config is used
179 (however we don't use pkg-config for some libraries (e.g., libev)).
180 By default, pkg-config searches ``*.pc`` file in the standard
186 .. code-block:: text
190 For pkg-config managed libraries, ``*_CFLAG`` and ``*_LIBS``
192 ``OPENSSL_LIBS``). Specifying non-empty string to these variables
193 completely overrides pkg-config. In other words, if they are
194 specified, pkg-config is not used for detection, and user is
195 responsible to specify the correct values to these variables. For
196 complete list of these variables, run ``./configure -h``.
199 -----------------------------------------
210 .. code-block:: text
212 $ tar xf nghttp2-X.Y.Z.tar.bz2
213 $ cd nghttp2-X.Y.Z
218 -----------------
223 .. code-block:: text
225 $ git submodule update --init
226 $ autoreconf -i
232 Notes for building on Windows (MSVC)
233 ------------------------------------
237 <http://landinghub.visualstudio.com/visual-cpp-build-tools>`_ works
240 1. Install cmake for windows
243 3. Then run ``cmake --build`` to build library.
247 No bundled applications are compiled.
249 Notes for building on Windows (Mingw/Cygwin)
250 --------------------------------------------
253 ``libnghttp2-X.dll`` and ``libnghttp2.a``.
267 .. code-block:: text
269 $ export CFLAGS="-U__STRICT_ANSI__ -I$libev_PREFIX/include -L$libev_PREFIX/lib"
278 Notes for installation on Linux systems
279 --------------------------------------------
282 .. code-block:: text
284 …oading shared libraries: libnghttp2.so.14: cannot open shared object file: No such file or directo…
291 --------------------------
299 .. code-block:: text
311 ----------
316 -----------------
318 We have the integration tests for the nghttpx proxy server. The tests are
324 * https://github.com/tatsuhiro-t/go-nghttp2
329 ``integration-tests`` directory:
331 .. code-block:: text
338 ---------------------------------
346 Previously we announced ``h2-14`` and ``h2c-14``. v1.0.0 implements
355 recompiling is enough for this change.
363 followed by SETTINGS frame. For clarification, we call "client magic"
364 for this 24 bytes byte string and updated API.
391 Remove HTTP Alternative Services (Alt-Svc) related code
394 Alt-Svc specification is not finalized yet. To make our API stable,
395 we have decided to remove all Alt-Svc related API from nghttp2.
400 We have already removed the functionality of Alt-Svc in v0.7 series
436 ---------------------------------
440 nghttp - client
446 It has verbose output mode for framing information. Here is sample
449 .. code-block:: text
451 $ nghttp -nv https://nghttp2.org
484 accept-encoding: gzip, deflate
485 user-agent: nghttp2/1.0.1-DEV
493 [ 0.221] recv (stream_id=13) accept-encoding: gzip, deflate
494 [ 0.222] recv (stream_id=13) user-agent: nghttp2/1.0.1-DEV
500 [ 0.222] recv (stream_id=13) content-type: text/html
501 [ 0.222] recv (stream_id=13) last-modified: Fri, 15 May 2015 15:38:06 GMT
502 [ 0.222] recv (stream_id=13) etag: W/"555612de-19f6"
504 [ 0.222] recv (stream_id=13) content-encoding: gzip
505 [ 0.222] recv (stream_id=13) server: nghttpx nghttp2/1.0.1-DEV
507 [ 0.222] recv (stream_id=13) strict-transport-security: max-age=31536000
516 [ 0.222] recv (stream_id=2) content-type: text/css
517 [ 0.222] recv (stream_id=2) last-modified: Fri, 15 May 2015 15:38:06 GMT
518 [ 0.222] recv (stream_id=2) etag: W/"555612de-9845"
519 [ 0.222] recv (stream_id=2) content-encoding: gzip
520 [ 0.222] recv (stream_id=2) server: nghttpx nghttp2/1.0.1-DEV
522 [ 0.222] recv (stream_id=2) strict-transport-security: max-age=31536000
534 .. code-block:: text
536 $ nghttp -nvu http://nghttp2.org
541 Connection: Upgrade, HTTP2-Settings
543 HTTP2-Settings: AAMAAABkAAQAAP__
545 User-Agent: nghttp2/1.0.1-DEV
582 [ 0.019] recv (stream_id=1) user-agent: nghttp2/1.0.1-DEV
588 [ 0.019] recv (stream_id=1) content-type: text/html
589 [ 0.019] recv (stream_id=1) content-length: 6646
590 [ 0.019] recv (stream_id=1) last-modified: Fri, 15 May 2015 15:38:06 GMT
591 [ 0.019] recv (stream_id=1) etag: "555612de-19f6"
593 [ 0.019] recv (stream_id=1) accept-ranges: bytes
594 [ 0.019] recv (stream_id=1) server: nghttpx nghttp2/1.0.1-DEV
604 [ 0.019] recv (stream_id=2) content-type: text/css
605 [ 0.019] recv (stream_id=2) content-length: 38981
606 [ 0.019] recv (stream_id=2) last-modified: Fri, 15 May 2015 15:38:06 GMT
607 [ 0.019] recv (stream_id=2) etag: "555612de-9845"
608 [ 0.019] recv (stream_id=2) accept-ranges: bytes
609 [ 0.019] recv (stream_id=2) server: nghttpx nghttp2/1.0.1-DEV
629 Using the ``-s`` option, ``nghttp`` prints out some timing information for
632 .. code-block:: text
634 $ nghttp -nas https://nghttp2.org/
643 process: responseEnd - requestStart
649 see http://www.w3.org/TR/resource-timing/#processing-model
657 15 +78.12ms +38.66ms 39.46ms 200 3K /javascripts/modernizr-2.0.js
659 Using the ``-r`` option, ``nghttp`` writes more detailed timing data to
662 nghttpd - server
665 ``nghttpd`` is a multi-threaded static web server.
667 By default, it uses SSL/TLS connection. Use ``--no-tls`` option to
671 HTTP/2 connections. No HTTP Upgrade is supported.
673 The ``-p`` option allows users to configure server push.
675 Just like ``nghttp``, it has a verbose output mode for framing
678 .. code-block:: text
680 $ nghttpd --no-tls -v 8080
681 IPv4: listen 0.0.0.0:8080
708 [id=1] [ 1.521] recv (stream_id=13) accept-encoding: gzip, deflate
709 [id=1] [ 1.521] recv (stream_id=13) user-agent: nghttp2/1.0.0-DEV
722 server: nghttpd nghttp2/1.0.0-DEV
723 content-length: 10
724 cache-control: max-age=3600
726 last-modified: Tue, 30 Sep 2014 12:40:52 GMT
734 nghttpx - proxy
737 ``nghttpx`` is a multi-threaded reverse proxy for HTTP/2, and
741 We reworked ``nghttpx`` command-line interface, and as a result, there
746 <https://nghttp2.org/documentation/nghttpx-howto.html#migration-from-nghttpx-v1-8-0-or-earlier>`_
749 ``nghttpx`` implements `important performance-oriented features
750 <https://istlsfastyet.com/#server-performance>`_ in TLS, such as
762 ``--http2-proxy`` HTTP/2, HTTP/1.1 HTTP/1.1, HTTP/2 Forward proxy
766 a reverse proxy and listens for HTTP/2, and HTTP/1.1 and can be
767 deployed as a SSL/TLS terminator for existing web server.
770 default. To disable encryption, use the ``no-tls`` keyword in
771 ``--frontend`` option. If encryption is disabled, incoming HTTP/1.1
774 encrypt backend connections, use ``tls`` keyword in ``--backend``
777 ``nghttpx`` supports a configuration file. See the ``--conf`` option and
783 .. code-block:: text
785 Client <-- (HTTP/2, HTTP/1.1) --> nghttpx <-- (HTTP/1.1, HTTP/2) --> Web Server
788 With the ``--http2-proxy`` option, it works as forward proxy, and it
791 .. code-block:: text
793 Client <-- (HTTP/2, HTTP/1.1) --> nghttpx <-- (HTTP/1.1) --> Proxy
803 .. code-block:: javascript
811 certificate for secure proxy.
815 .. code-block:: text
817 $ google-chrome --proxy-pac-url=file:///path/to/proxy.pac --use-npn
820 The proxy is specified using ``--backend-http-proxy-uri``. The
824 .. code-block:: text
826 Client <-- (HTTP/2, HTTP/1.1) --> nghttpx <-- (HTTP/2) --
828 --===================---> HTTP/2 Proxy
829 (HTTP proxy tunnel) (e.g., nghttpx -s)
832 -----------------
834 The ``h2load`` program is a benchmarking tool for HTTP/2. The UI of
839 .. code-block:: text
841 $ h2load -n100000 -c100 -m100 https://localhost:8443/
845 Cipher: ECDHE-RSA-AES128-GCM-SHA256
846 Server Temp Key: ECDH P-256 256 bits
862 min max mean sd +/- sd
863 time for request: 25.12ms 124.55ms 51.07ms 15.36ms 84.87%
864 time for connect: 208.94ms 254.67ms 241.38ms 7.95ms 63.00%
869 per client. With the ``-t`` option, ``h2load`` will use multiple native
879 -----------
882 command-line header compression tool. The ``inflatehd`` program is a
883 command-line header decompression tool. Both tools read input from
886 format described at https://github.com/http2jp/hpack-test-case.
888 deflatehd - header compressor
891 The ``deflatehd`` program reads JSON data or HTTP/1-style header fields from
894 For the JSON input, the root JSON object must include a ``cases`` key.
903 .. code-block:: json
924 With the ``-t`` option, the program can accept more familiar HTTP/1 style
929 .. code-block:: text
936 user-agent: nghttp2
964 .. code-block:: json
989 "user-agent": "nghttp2"
1015 "user-agent": "nghttp2"
1024 The output can be used as the input for ``inflatehd`` and
1027 With the ``-d`` option, the extra ``header_table`` key is added and its
1056 that they are no longer referenced.
1060 .. code-block:: json
1085 "user-agent": "nghttp2"
1093 "name": "user-agent",
1154 "user-agent": "nghttp2"
1169 "name": "user-agent",
1212 inflatehd - header decompressor
1226 .. code-block:: json
1254 .. code-block:: json
1276 "user-agent": "nghttp2"
1293 "user-agent": "nghttp2"
1307 The output can be used as the input for ``deflatehd`` and
1310 With the ``-d`` option, the extra ``header_table`` key is added and its
1316 ----------------------------------------------
1323 libnghttp2_asio is not built by default. Use the ``--enable-asio-lib``
1335 .. code-block:: cpp
1360 .. code-block:: cpp
1383 req->on_response([](const response &res) {
1386 for (auto &kv : res.header()) {
1397 req->on_close([&sess](uint32_t error_code) {
1410 For more details, see the documentation of libnghttp2_asio.
1413 ---------------
1430 .. code-block:: python
1456 If the request has a request body, ``on_data(data)`` is invoked for each
1495 .. code-block:: python
1506 request_headers = [('content-length', '3')],
1512 request_headers = [('content-length', '10')],
1517 headers = [('content-type', 'text/plain')],
1518 body=io.BytesIO(b'nghttp2-python FTW'))
1524 # give None to ssl to make the server non-SSL/TLS
1529 ------------
1546 We will credit you for your
1552 <https://nghttp2.org/documentation/contribute.html>`_ for more
1556 -----------------------
1564 In the future, we may setup a dedicated mail address for this purpose.
1567 ----------------
1573 We may release PATCH releases between the regular releases, mainly for
1576 We have no plan to break API compatibility changes involving soname
1577 bump, so MAJOR version will stay 1 for the foreseeable future.
1580 -------