Update doc

This commit is contained in:
Tatsuhiro Tsujikawa 2016-04-16 18:58:18 +09:00
parent f86a9d654d
commit 73740477fb
1 changed files with 48 additions and 16 deletions

View File

@ -104,7 +104,9 @@ The Python bindings require the following packages:
* python >= 2.7 * python >= 2.7
* python-setuptools * 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 \ 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 \ 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 Building from git is easy, but please be sure that at least autoconf 2.68 is
used:: used:
.. code-block:: text
$ autoreconf -i $ autoreconf -i
$ automake $ 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 not, the functions ``fdopen``, ``fileno`` and ``strptime`` will not
available. 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 CFLAGS="-U__STRICT_ANSI__ -I$libev_PREFIX/include -L$libev_PREFIX/lib"
$ export CXXFLAGS=$CFLAGS $ export CXXFLAGS=$CFLAGS
@ -206,7 +212,9 @@ Building the documentation
Documentation is still incomplete. Documentation is still incomplete.
To build the documentation, run:: To build the documentation, run:
.. code-block:: text
$ make html $ make html
@ -235,12 +243,16 @@ its testing framework. We depend on the following libraries:
* https://github.com/tatsuhiro-t/spdy * https://github.com/tatsuhiro-t/spdy
To download the above packages, after settings ``GOPATH``, run the 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 $ make itprep
To run the tests, run the following command under To run the tests, run the following command under
``integration-tests`` directory:: ``integration-tests`` directory:
.. code-block:: text
$ make it $ make it
@ -361,7 +373,9 @@ nghttp - client
with prior knowledge, HTTP Upgrade and NPN/ALPN TLS extension. with prior knowledge, HTTP Upgrade and NPN/ALPN TLS extension.
It has verbose output mode for framing information. Here is sample 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 $ nghttp -nv https://nghttp2.org
[ 0.190] Connected [ 0.190] Connected
@ -444,7 +458,9 @@ output from ``nghttp`` client::
[ 0.228] send GOAWAY frame <length=8, flags=0x00, stream_id=0> [ 0.228] send GOAWAY frame <length=8, flags=0x00, stream_id=0>
(last_stream_id=2, error_code=NO_ERROR(0x00), opaque_data(0)=[]) (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 $ nghttp -nvu http://nghttp2.org
[ 0.011] Connected [ 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)=[]) (last_stream_id=2, error_code=NO_ERROR(0x00), opaque_data(0)=[])
Using the ``-s`` option, ``nghttp`` prints out some timing information for 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/ $ nghttp -nas https://nghttp2.org/
***** Statistics ***** ***** Statistics *****
@ -584,7 +602,9 @@ HTTP/2 connections. No HTTP Upgrade is supported.
The ``-p`` option allows users to configure server push. The ``-p`` option allows users to configure server push.
Just like ``nghttp``, it has a verbose output mode for framing 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 $ nghttpd --no-tls -v 8080
IPv4: listen 0.0.0.0: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``. sample configuration file ``nghttpx.conf.sample``.
In the default mode, ``nghttpx`` works as reverse proxy to the backend 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 Client <-- (HTTP/2, SPDY, HTTP/1.1) --> nghttpx <-- (HTTP/1.1, HTTP/2) --> Web Server
[reverse proxy] [reverse proxy]
With the ``--http2-proxy`` option, it works as forward proxy, and it 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 Client <-- (HTTP/2, SPDY, HTTP/1.1) --> nghttpx <-- (HTTP/1.1) --> Proxy
[secure proxy] (e.g., Squid, ATS) [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 machine nghttpx is running on. Please note that Chrome requires a valid
certificate for secure proxy. 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 $ 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 backend HTTP/2 connections can be tunneled through an HTTP proxy.
The proxy is specified using ``--backend-http-proxy-uri``. The The proxy is specified using ``--backend-http-proxy-uri``. The
following figure illustrates how nghttpx talks to the outside HTTP/2 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) -- 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 The SPDY support is enabled if the program was built with the spdylay
library. The UI of ``h2load`` is heavily inspired by ``weighttp`` library. The UI of ``h2load`` is heavily inspired by ``weighttp``
(https://github.com/lighttpd/weighttp). The typical usage is as (https://github.com/lighttpd/weighttp). The typical usage is as
follows:: follows:
.. code-block:: text
$ h2load -n100000 -c100 -m100 https://localhost:8443/ $ h2load -n100000 -c100 -m100 https://localhost:8443/
starting benchmark... starting benchmark...
@ -825,7 +855,9 @@ Example:
With the ``-t`` option, the program can accept more familiar HTTP/1 style 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: header field blocks. Each header set is delimited by an empty line:
Example:: Example:
.. code-block:: text
:method: GET :method: GET
:scheme: https :scheme: https