From 73740477fb8d5e0af5c5a6467fba2152a8966aa2 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 16 Apr 2016 18:58:18 +0900 Subject: [PATCH] Update doc --- README.rst | 64 ++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 48 insertions(+), 16 deletions(-) diff --git a/README.rst b/README.rst index c5b21b25..96390c70 100644 --- a/README.rst +++ b/README.rst @@ -104,7 +104,9 @@ The Python bindings require the following packages: * python >= 2.7 * python-setuptools -If you are using Ubuntu 14.04 LTS (trusty) or Debian 7.0 (wheezy) and above run the following to install the needed packages:: +If you are using Ubuntu 14.04 LTS (trusty) or Debian 7.0 (wheezy) and above run the following to install the needed packages: + +.. code-block:: text sudo apt-get install g++ make binutils autoconf automake autotools-dev libtool pkg-config \ zlib1g-dev libcunit1-dev libssl-dev libxml2-dev libev-dev libevent-dev libjansson-dev \ @@ -138,7 +140,9 @@ Building from git ----------------- Building from git is easy, but please be sure that at least autoconf 2.68 is -used:: +used: + +.. code-block:: text $ autoreconf -i $ automake @@ -188,7 +192,9 @@ Secondly, you need to undefine the macro ``__STRICT_ANSI__``, if you not, the functions ``fdopen``, ``fileno`` and ``strptime`` will not available. -the sample command like this:: +the sample command like this: + +.. code-block:: text $ export CFLAGS="-U__STRICT_ANSI__ -I$libev_PREFIX/include -L$libev_PREFIX/lib" $ export CXXFLAGS=$CFLAGS @@ -206,7 +212,9 @@ Building the documentation Documentation is still incomplete. -To build the documentation, run:: +To build the documentation, run: + +.. code-block:: text $ make html @@ -235,12 +243,16 @@ its testing framework. We depend on the following libraries: * https://github.com/tatsuhiro-t/spdy To download the above packages, after settings ``GOPATH``, run the -following command under ``integration-tests`` directory:: +following command under ``integration-tests`` directory: + +.. code-block:: text $ make itprep To run the tests, run the following command under -``integration-tests`` directory:: +``integration-tests`` directory: + +.. code-block:: text $ make it @@ -361,7 +373,9 @@ nghttp - client with prior knowledge, HTTP Upgrade and NPN/ALPN TLS extension. It has verbose output mode for framing information. Here is sample -output from ``nghttp`` client:: +output from ``nghttp`` client: + +.. code-block:: text $ nghttp -nv https://nghttp2.org [ 0.190] Connected @@ -444,7 +458,9 @@ output from ``nghttp`` client:: [ 0.228] send GOAWAY frame (last_stream_id=2, error_code=NO_ERROR(0x00), opaque_data(0)=[]) -The HTTP Upgrade is performed like so:: +The HTTP Upgrade is performed like so: + +.. code-block:: text $ nghttp -nvu http://nghttp2.org [ 0.011] Connected @@ -540,7 +556,9 @@ The HTTP Upgrade is performed like so:: (last_stream_id=2, error_code=NO_ERROR(0x00), opaque_data(0)=[]) Using the ``-s`` option, ``nghttp`` prints out some timing information for -requests, sorted by completion time:: +requests, sorted by completion time: + +.. code-block:: text $ nghttp -nas https://nghttp2.org/ ***** Statistics ***** @@ -584,7 +602,9 @@ HTTP/2 connections. No HTTP Upgrade is supported. The ``-p`` option allows users to configure server push. Just like ``nghttp``, it has a verbose output mode for framing -information. Here is sample output from ``nghttpd``:: +information. Here is sample output from ``nghttpd``: + +.. code-block:: text $ nghttpd --no-tls -v 8080 IPv4: listen 0.0.0.0:8080 @@ -688,13 +708,17 @@ are not encrypted by default. To encrypt backend connections, use sample configuration file ``nghttpx.conf.sample``. In the default mode, ``nghttpx`` works as reverse proxy to the backend -server:: +server: + +.. code-block:: text Client <-- (HTTP/2, SPDY, HTTP/1.1) --> nghttpx <-- (HTTP/1.1, HTTP/2) --> Web Server [reverse proxy] With the ``--http2-proxy`` option, it works as forward proxy, and it -is so called secure HTTP/2 proxy (aka SPDY proxy):: +is so called secure HTTP/2 proxy (aka SPDY proxy): + +.. code-block:: text Client <-- (HTTP/2, SPDY, HTTP/1.1) --> nghttpx <-- (HTTP/1.1) --> Proxy [secure proxy] (e.g., Squid, ATS) @@ -716,14 +740,18 @@ create a proxy.pac script like this: machine nghttpx is running on. Please note that Chrome requires a valid certificate for secure proxy. -Then run Chrome with the following arguments:: +Then run Chrome with the following arguments: + +.. code-block:: text $ google-chrome --proxy-pac-url=file:///path/to/proxy.pac --use-npn The backend HTTP/2 connections can be tunneled through an HTTP proxy. The proxy is specified using ``--backend-http-proxy-uri``. The following figure illustrates how nghttpx talks to the outside HTTP/2 -proxy through an HTTP proxy:: +proxy through an HTTP proxy: + +.. code-block:: text Client <-- (HTTP/2, SPDY, HTTP/1.1) --> nghttpx <-- (HTTP/2) -- @@ -737,7 +765,9 @@ The ``h2load`` program is a benchmarking tool for HTTP/2 and SPDY. The SPDY support is enabled if the program was built with the spdylay library. The UI of ``h2load`` is heavily inspired by ``weighttp`` (https://github.com/lighttpd/weighttp). The typical usage is as -follows:: +follows: + +.. code-block:: text $ h2load -n100000 -c100 -m100 https://localhost:8443/ starting benchmark... @@ -825,7 +855,9 @@ Example: With the ``-t`` option, the program can accept more familiar HTTP/1 style header field blocks. Each header set is delimited by an empty line: -Example:: +Example: + +.. code-block:: text :method: GET :scheme: https