Update doc

This commit is contained in:
Tatsuhiro Tsujikawa 2014-04-08 23:12:02 +09:00
parent 6326aec089
commit 8658163aac
1 changed files with 65 additions and 67 deletions

View File

@ -348,10 +348,10 @@ a reverse proxy and listens for ``h2-11``, SPDY and HTTP/1.1 and can
be deployed SSL/TLS terminator for existing web server.
The default mode, ``--http2-proxy`` and ``--http2-bridge`` modes use
SSL/TLS in the frontend connection by default. To disable SSL/TLS, use
``--frontend-no-tls`` option. If that option is used, SPDY is disabled
in the frontend and incoming HTTP/1.1 connection can be upgraded to
HTTP/2 through HTTP Upgrade.
SSL/TLS in the frontend connection by default. To disable SSL/TLS,
use ``--frontend-no-tls`` option. If that option is used, SPDY is
disabled in the frontend and incoming HTTP/1.1 connection can be
upgraded to HTTP/2 through HTTP Upgrade.
The ``--http2-bridge``, ``--client`` and ``--client-proxy`` modes use
SSL/TLS in the backend connection by deafult. To disable SSL/TLS, use
@ -423,11 +423,11 @@ The frontend HTTP/1.1 connection can be upgraded to HTTP/2
through HTTP Upgrade.
For the operation modes which talk to the backend in HTTP/2 over
SSL/TLS, the backend connections can be tunneled through HTTP
proxy. The proxy is specified using ``--backend-http-proxy-uri``
option. The following figure illustrates the example of
``--http2-bridge`` and ``--backend-http-proxy-uri`` options to talk to
the outside HTTP/2 proxy through HTTP proxy::
SSL/TLS, the backend connections can be tunneled through HTTP proxy.
The proxy is specified using ``--backend-http-proxy-uri`` option. The
following figure illustrates the example of ``--http2-bridge`` and
``--backend-http-proxy-uri`` options to talk to the outside HTTP/2
proxy through HTTP proxy::
Client <-- (HTTP/2, SPDY, HTTP/1.1) --> nghttpx <-- (HTTP/2) --
@ -439,9 +439,9 @@ Benchmarking tool
The ``h2load`` program is a benchmarking tool for HTTP/2 and SPDY.
The SPDY support is enabled if the program was built with spdylay
library. The UI of ``h2load`` is heavily inspired by
``weighttp`` (https://github.com/lighttpd/weighttp). The typical usage
is as follows::
library. The UI of ``h2load`` is heavily inspired by ``weighttp``
(https://github.com/lighttpd/weighttp). The typical usage is as
follows::
$ src/h2load -n1000 -c10 -m10 https://127.0.0.1:8443/
starting benchmark...
@ -468,8 +468,8 @@ avoid saturating single core on client side.
.. warning::
**Don't use this tool against publicly available servers.** That
is considered a DOS attack. Please only use against your private
**Don't use this tool against publicly available servers.** That is
considered a DOS attack. Please only use against your private
servers.
HPACK tools
@ -478,9 +478,9 @@ HPACK tools
The ``src`` directory contains HPACK tools. The ``deflatehd`` is a
command-line header compression tool. The ``inflatehd`` is
command-line header decompression tool. Both tools read input from
stdin and write output to stdout. The errors are written to
stderr. They take JSON as input and output. We use the same JSON data
format used in https://github.com/Jxck/hpack-test-case
stdin and write output to stdout. The errors are written to stderr.
They take JSON as input and output. We use (mostly) same JSON data
format described at https://github.com/http2jp/hpack-test-case
deflatehd - header compressor
+++++++++++++++++++++++++++++
@ -488,9 +488,9 @@ deflatehd - header compressor
The ``deflatehd`` reads JSON data or HTTP/1-style header fields from
stdin and outputs compressed header block in JSON.
For the JSON input, the root JSON object must include ``cases``
key. Its value has to include the sequence of input header set. They
share the same compression context and are processed in the order they
For the JSON input, the root JSON object must include ``cases`` key.
Its value has to include the sequence of input header set. They share
the same compression context and are processed in the order they
appear. Each item in the sequence is a JSON object and it must
include ``headers`` key. Its value is an array of a JSON object,
which includes exactly one name/value pair.
@ -621,18 +621,15 @@ The output can be used as the input for ``inflatehd`` and
With ``-d`` option, the extra ``header_table`` key is added and its
associated value includes the state of dynamic header table after the
corresponding header set was processed. The value includes at least the
following keys:
corresponding header set was processed. The value includes at least
the following keys:
entries
The entry in the header table. If ``referenced`` is ``true``, it
is in the reference set. The ``size`` includes the overhead (32
bytes). The ``index`` corresponds to the index of header table.
The ``name`` is the header field name and the ``value`` is the
header field value. They may be displayed as ``**DEALLOCATED**``,
which means that the memory for that string is freed and not
available. This will happen when the specifying smaller value in
``-S`` than ``-s``.
header field value.
size
The sum of the spaces entries occupied, this includes the
@ -914,8 +911,8 @@ Python bindings
---------------
This ``python`` directory contains nghttp2 Python bindings. The
bindings currently provide HPACK compressor and decompressor
classes and HTTP/2 server.
bindings currently provide HPACK compressor and decompressor classes
and HTTP/2 server.
The extension module is called ``nghttp2``.
@ -944,12 +941,12 @@ and decompressor in Python:
print(hdrs)
The ``nghttp2.HTTP2Server`` class builds on top of the asyncio event
loop. On construction, *RequestHandlerClass* must be given, which must
be a subclass of ``nghttp2.BaseRequestHandler`` class.
loop. On construction, *RequestHandlerClass* must be given, which
must be a subclass of ``nghttp2.BaseRequestHandler`` class.
The ``BaseRequestHandler`` class is used to handle the HTTP/2
stream. By default, it does nothing. It must be subclassed to
handle each event callback method.
The ``BaseRequestHandler`` class is used to handle the HTTP/2 stream.
By default, it does nothing. It must be subclassed to handle each
event callback method.
The first callback method invoked is ``on_headers()``. It is called
when HEADERS frame, which includes request header fields, has arrived.
@ -961,8 +958,8 @@ When whole request is received, ``on_request_done()`` is invoked.
When stream is closed, ``on_close(error_code)`` is called.
The application can send response using ``send_response()`` method. It
can be used in ``on_headers()``, ``on_data()`` or
The application can send response using ``send_response()`` method.
It can be used in ``on_headers()``, ``on_data()`` or
``on_request_done()``.
The application can push resource using ``push()`` method. It must be
@ -978,7 +975,8 @@ stream_id
Stream ID of this stream.
scheme
Scheme of the request URI. This is a value of :scheme header field.
Scheme of the request URI. This is a value of :scheme header
field.
method
Method of this stream. This is a value of :method header field.