Update doc

This commit is contained in:
Tatsuhiro Tsujikawa 2015-03-14 18:59:44 +09:00
parent bed3902c61
commit e2a3c660a5
26 changed files with 2491 additions and 628 deletions

View File

@ -7,7 +7,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>API Reference &mdash; nghttp2 0.7.2-DEV documentation</title>
<title>API Reference &mdash; nghttp2 0.7.8-DEV documentation</title>
@ -28,7 +28,7 @@
<link rel="top" title="nghttp2 0.7.2-DEV documentation" href="index.html"/>
<link rel="top" title="nghttp2 0.7.8-DEV documentation" href="index.html"/>
<link rel="next" title="libnghttp2_asio: High level HTTP/2 C++ library" href="libnghttp2_asio.html"/>
<link rel="prev" title="h2load - HTTP/2 benchmarking tool - HOW-TO" href="h2load-howto.html"/>
@ -100,30 +100,33 @@
<li class="toctree-l1"><a class="reference internal" href="nghttp.1.html">nghttp(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpd.1.html">nghttpd(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpx.1.html">nghttpx(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#files">FILES</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#signals">SIGNALS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#server-push">SERVER PUSH</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#unix-domain-socket">UNIX DOMAIN SOCKET</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load.1.html">h2load(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#output">OUTPUT</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
@ -139,7 +142,7 @@
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#rewriting-location-header-field">Rewriting location header field</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#hot-swapping">Hot swapping</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#re-opening-log-files">Re-opening log files</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-http-1-backend-addresses">Multiple HTTP/1 backend addresses</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-backend-addresses">Multiple backend addresses</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load-howto.html">h2load - HTTP/2 benchmarking tool - HOW-TO</a><ul>
@ -153,6 +156,7 @@
<li class="toctree-l1 current"><a class="current reference internal" href="">API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#includes">Includes</a></li>
<li class="toctree-l2"><a class="reference internal" href="#remarks">Remarks</a></li>
<li class="toctree-l2"><a class="reference internal" href="#http-messaging">HTTP Messaging</a></li>
<li class="toctree-l2"><a class="reference internal" href="#macros">Macros</a></li>
<li class="toctree-l2"><a class="reference internal" href="#enums">Enums</a></li>
<li class="toctree-l2"><a class="reference internal" href="#types-structs-unions-and-typedefs">Types (structs, unions and typedefs)</a></li>
@ -161,6 +165,7 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="libnghttp2_asio.html">libnghttp2_asio: High level HTTP/2 C++ library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#server-api">Server API</a></li>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#client-api">Client API</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="python-apiref.html">Python API Reference</a><ul>
@ -170,6 +175,8 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2.h.html">nghttp2.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2ver.h.html">nghttp2ver.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_server.h.html">asio_http2_server.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_client.h.html">asio_http2_client.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2.h.html">asio_http2.h</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2">Source</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2/issues">Issues</a></li>
@ -237,6 +244,63 @@ value. The applications are responsible to receive it before calling
these functions if <a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_session</span></tt></a> is configured as server and
<a class="reference internal" href="#c.nghttp2_option_set_recv_client_preface" title="nghttp2_option_set_recv_client_preface"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_option_set_recv_client_preface()</span></tt></a> is not used.</p>
</div>
<div class="section" id="http-messaging">
<h2>HTTP Messaging<a class="headerlink" href="#http-messaging" title="Permalink to this headline"></a></h2>
<p>By default, nghttp2 library checks HTTP messaging rules described in
<a class="reference external" href="https://tools.ietf.org/html/draft-ietf-httpbis-http2-17#section-8">HTTP/2 specification, section 8</a>.
Everything described in that section is not validated however. We
briefly describe what the library does in this area. In the following
description, without loss of generality we omit CONTINUATION frame
since they must follow HEADERS frame and are processed atomically. In
other words, they are just one big HEADERS frame. To disable these
validations, use <a class="reference internal" href="#c.nghttp2_option_set_no_http_messaging" title="nghttp2_option_set_no_http_messaging"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_option_set_no_http_messaging()</span></tt></a>.</p>
<p>For HTTP request, including those carried by PUSH_PROMISE, HTTP
message starts with one HEADERS frame containing request headers. It
is followed by zero or more DATA frames containing request body, which
is followed by zero or one HEADERS containing trailer headers. The
request headers must include &quot;:scheme&quot;, &quot;:method&quot; and &quot;:path&quot; pseudo
header fields unless &quot;:method&quot; is not &quot;CONNECT&quot;. &quot;:authority&quot; is
optional, but nghttp2 requires either &quot;:authority&quot; or &quot;Host&quot; header
field must be present. If &quot;:method&quot; is &quot;CONNECT&quot;, the request headers
must include &quot;:method&quot; and &quot;:authority&quot; and must omit &quot;:scheme&quot; and
&quot;:path&quot;.</p>
<p>For HTTP response, HTTP message starts with zero or more HEADERS
frames containing non-final response (status code 1xx). They are
followed by one HEADERS frame containing final response headers
(non-1xx). It is followed by zero or more DATA frames containing
response body, which is followed by zero or one HEADERS containing
trailer headers. The non-final and final response headers must
contain &quot;:status&quot; pseudo header field containing 3 digits only.</p>
<p>All request and response headers must include exactly one valid value
for each pseudo header field. Additionally nghttp2 requires all
request headers must not include more than one &quot;Host&quot; header field.</p>
<p>HTTP/2 prohibits connection-specific header fields. The following
header fields must not appear: &quot;Connection&quot;, &quot;Keep-Alive&quot;,
&quot;Proxy-Connection&quot;, &quot;Transfer-Encoding&quot; and &quot;Upgrade&quot;. Additionally,
&quot;TE&quot; header field must not include any value other than &quot;trailers&quot;.</p>
<p>Each header field name and value must obey the field-name and
field-value production rules described in <a class="reference external" href="https://tools.ietf.org/html/rfc7230#section-3.2">RFC 7230, section
3.2.</a>.
Additionally, all field name must be lower cased. While the pseudo
header fields must satisfy these rules, we just ignore illegal regular
headers (this means that these header fields are not passed to
application callback). This is because these illegal header fields
are floating around in existing internet and resetting stream just
because of this may break many web sites. This is especially true if
we forward to or translate from HTTP/1 traffic.</p>
<p>With the above validations, nghttp2 library guarantees that header
field name passed to <a class="reference internal" href="#c.nghttp2_on_header_callback" title="nghttp2_on_header_callback"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_on_header_callback()</span></tt></a> is not empty.
Also required pseudo headers are all present and not empty.</p>
<p>nghttp2 enforces &quot;Content-Length&quot; validation as well. All request or
response headers must not contain more than one &quot;Content-Length&quot;
header field. If &quot;Content-Length&quot; header field is present, it must be
parsed as 64 bit signed integer. The sum of data length in the
following DATA frames must match with the number in &quot;Content-Length&quot;
header field if it is present (this does not include padding bytes).</p>
<p>Any deviation results in stream error of type PROTOCOL_ERROR. If
error is found in PUSH_PROMISE frame, stream error is raised against
promised stream.</p>
</div>
<div class="section" id="macros">
<h2>Macros<a class="headerlink" href="#macros" title="Permalink to this headline"></a></h2>
<dl class="macro">
@ -266,6 +330,22 @@ supports. This identifier is used if HTTP/2 is used over TLS.</p>
<dd><p>The length of <a class="reference internal" href="#c.NGHTTP2_PROTO_VERSION_ID" title="NGHTTP2_PROTO_VERSION_ID"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_PROTO_VERSION_ID</span></tt></a>.</p>
</dd></dl>
<dl class="macro">
<dt id="c.NGHTTP2_PROTO_ALPN">
<tt class="descname">NGHTTP2_PROTO_ALPN</tt><a class="headerlink" href="#c.NGHTTP2_PROTO_ALPN" title="Permalink to this definition"></a></dt>
<dd><p>The seriazlied form of ALPN protocol identifier this library
supports. Notice that first byte is the length of following
protocol identifier. This is the same wire format of <a class="reference external" href="https://tools.ietf.org/html/rfc7301">TLS ALPN
extension</a>. This is useful
to process incoming ALPN tokens in wire format.</p>
</dd></dl>
<dl class="macro">
<dt id="c.NGHTTP2_PROTO_ALPN_LEN">
<tt class="descname">NGHTTP2_PROTO_ALPN_LEN</tt><a class="headerlink" href="#c.NGHTTP2_PROTO_ALPN_LEN" title="Permalink to this definition"></a></dt>
<dd><p>The length of <a class="reference internal" href="#c.NGHTTP2_PROTO_ALPN" title="NGHTTP2_PROTO_ALPN"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_PROTO_ALPN</span></tt></a>.</p>
</dd></dl>
<dl class="macro">
<dt id="c.NGHTTP2_CLEARTEXT_PROTO_VERSION_ID">
<tt class="descname">NGHTTP2_CLEARTEXT_PROTO_VERSION_ID</tt><a class="headerlink" href="#c.NGHTTP2_CLEARTEXT_PROTO_VERSION_ID" title="Permalink to this definition"></a></dt>
@ -588,6 +668,14 @@ The current session is closing due to a connection error or
<a class="reference internal" href="#c.nghttp2_session_terminate_session" title="nghttp2_session_terminate_session"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_terminate_session()</span></tt></a> is called.</p>
</dd></dl>
<dl class="macro">
<dt id="c.NGHTTP2_ERR_HTTP_HEADER">
<tt class="descname">NGHTTP2_ERR_HTTP_HEADER</tt><a class="headerlink" href="#c.NGHTTP2_ERR_HTTP_HEADER" title="Permalink to this definition"></a></dt>
<dd><p>(<tt class="docutils literal"><span class="pre">-531</span></tt>)
Invalid HTTP header field was received and stream is going to be
closed.</p>
</dd></dl>
<dl class="macro">
<dt id="c.NGHTTP2_ERR_FATAL">
<tt class="descname">NGHTTP2_ERR_FATAL</tt><a class="headerlink" href="#c.NGHTTP2_ERR_FATAL" title="Permalink to this definition"></a></dt>
@ -639,7 +727,9 @@ No flag set.</p>
<dt id="c.NGHTTP2_NV_FLAG_NO_INDEX">
<tt class="descname">NGHTTP2_NV_FLAG_NO_INDEX</tt><a class="headerlink" href="#c.NGHTTP2_NV_FLAG_NO_INDEX" title="Permalink to this definition"></a></dt>
<dd><p>(<tt class="docutils literal"><span class="pre">0x01</span></tt>)
Indicates that this name/value pair must not be indexed.</p>
Indicates that this name/value pair must not be indexed (&quot;Literal
Header Field never Indexed&quot; representation must be used in HPACK
encoding). Other implementation calls this bit as &quot;sensitive&quot;.</p>
</dd></dl>
</dd></dl>
@ -715,7 +805,9 @@ The WINDOW_UPDATE frame.</p>
<dt id="c.NGHTTP2_CONTINUATION">
<tt class="descname">NGHTTP2_CONTINUATION</tt><a class="headerlink" href="#c.NGHTTP2_CONTINUATION" title="Permalink to this definition"></a></dt>
<dd><p>(<tt class="docutils literal"><span class="pre">0x09</span></tt>)
The CONTINUATION frame.</p>
The CONTINUATION frame. This frame type won't be passed to any
callbacks because the library processes this frame type and its
preceding HEADERS/PUSH_PROMISE as a single frame.</p>
</dd></dl>
</dd></dl>
@ -955,6 +1047,16 @@ No flag set.</p>
Indicates EOF was sensed.</p>
</dd></dl>
<dl class="macro">
<dt id="c.NGHTTP2_DATA_FLAG_NO_END_STREAM">
<tt class="descname">NGHTTP2_DATA_FLAG_NO_END_STREAM</tt><a class="headerlink" href="#c.NGHTTP2_DATA_FLAG_NO_END_STREAM" title="Permalink to this definition"></a></dt>
<dd><p>(<tt class="docutils literal"><span class="pre">0x02</span></tt>)
Indicates that END_STREAM flag must not be set even if
NGHTTP2_DATA_FLAG_EOF is set. Usually this flag is used to send
trailer header fields with <a class="reference internal" href="#c.nghttp2_submit_request" title="nghttp2_submit_request"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_submit_request()</span></tt></a> or
<a class="reference internal" href="#c.nghttp2_submit_response" title="nghttp2_submit_response"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_submit_response()</span></tt></a>.</p>
</dd></dl>
</dd></dl>
<dl class="type">
@ -1176,6 +1278,20 @@ The implementation of this function must read at most <em>length</em>
bytes of data from <em>source</em> (or possibly other places) and store
them in <em>buf</em> and return number of data stored in <em>buf</em>. If EOF is
reached, set <a class="reference internal" href="#c.NGHTTP2_DATA_FLAG_EOF" title="NGHTTP2_DATA_FLAG_EOF"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_DATA_FLAG_EOF</span></tt></a> flag in <em>*data_flags</em>.</p>
<p>If this callback is set by <a class="reference internal" href="#c.nghttp2_submit_request" title="nghttp2_submit_request"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_submit_request()</span></tt></a>,
<a class="reference internal" href="#c.nghttp2_submit_response" title="nghttp2_submit_response"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_submit_response()</span></tt></a> or <a class="reference internal" href="#c.nghttp2_submit_headers" title="nghttp2_submit_headers"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_submit_headers()</span></tt></a> and
<a class="reference internal" href="#c.nghttp2_submit_data" title="nghttp2_submit_data"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_submit_data()</span></tt></a> with flag parameter
<a class="reference internal" href="#c.NGHTTP2_FLAG_END_STREAM" title="NGHTTP2_FLAG_END_STREAM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_FLAG_END_STREAM</span></tt></a> set, and
<a class="reference internal" href="#c.NGHTTP2_DATA_FLAG_EOF" title="NGHTTP2_DATA_FLAG_EOF"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_DATA_FLAG_EOF</span></tt></a> flag is set to <em>*data_flags</em>, DATA
frame will have END_STREAM flag set. Usually, this is expected
behaviour and all are fine. One exception is send trailer header
fields. You cannot send trailers after sending frame with
END_STREAM set. To avoid this problem, one can set
<a class="reference internal" href="#c.NGHTTP2_DATA_FLAG_NO_END_STREAM" title="NGHTTP2_DATA_FLAG_NO_END_STREAM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_DATA_FLAG_NO_END_STREAM</span></tt></a> along with
<a class="reference internal" href="#c.NGHTTP2_DATA_FLAG_EOF" title="NGHTTP2_DATA_FLAG_EOF"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_DATA_FLAG_EOF</span></tt></a> to signal the library not to set
END_STREAM in DATA frame. Then application can use
<a class="reference internal" href="#c.nghttp2_submit_trailer" title="nghttp2_submit_trailer"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_submit_trailer()</span></tt></a> to send trailers.
<a class="reference internal" href="#c.nghttp2_submit_trailer" title="nghttp2_submit_trailer"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_submit_trailer()</span></tt></a> can be called inside this callback.</p>
<p>If the application wants to postpone DATA frames (e.g.,
asynchronous I/O, or reading data blocks for long time), it is
achieved by returning <a class="reference internal" href="#c.NGHTTP2_ERR_DEFERRED" title="NGHTTP2_ERR_DEFERRED"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_DEFERRED</span></tt></a> without reading
@ -1814,6 +1930,8 @@ argument passed in to the call to <a class="reference internal" href="#c.nghttp2
If nonzero is returned, it is treated as fatal error and
<a class="reference internal" href="#c.nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#c.nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> functions
immediately return <a class="reference internal" href="#c.NGHTTP2_ERR_CALLBACK_FAILURE" title="NGHTTP2_ERR_CALLBACK_FAILURE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_CALLBACK_FAILURE</span></tt></a>.</p>
<p><a class="reference internal" href="#c.nghttp2_session_get_stream_user_data" title="nghttp2_session_get_stream_user_data"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_get_stream_user_data()</span></tt></a> can be used to get
associated data.</p>
<p>To set this callback to <a class="reference internal" href="#c.nghttp2_session_callbacks" title="nghttp2_session_callbacks"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_session_callbacks</span></tt></a>, use
<a class="reference internal" href="#c.nghttp2_session_callbacks_set_on_frame_not_send_callback" title="nghttp2_session_callbacks_set_on_frame_not_send_callback"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_callbacks_set_on_frame_not_send_callback()</span></tt></a>.</p>
</dd></dl>
@ -1849,6 +1967,25 @@ will be emitted by <a class="reference internal" href="#c.nghttp2_on_header_call
or more CONTINUATION frames are involved. But the application does
not need to care about that because the header name/value pairs are
emitted transparently regardless of CONTINUATION frames.</p>
<p>The server applications probably create an object to store
information about new stream if <tt class="docutils literal"><span class="pre">frame-&gt;hd.type</span> <span class="pre">==</span>
<span class="pre">NGHTTP2_HEADERS</span></tt> and <tt class="docutils literal"><span class="pre">frame-&gt;headers.cat</span> <span class="pre">==</span>
<span class="pre">NGHTTP2_HCAT_REQUEST</span></tt>. If <em>session</em> is configured as server side,
<tt class="docutils literal"><span class="pre">frame-&gt;headers.cat</span></tt> is either <tt class="docutils literal"><span class="pre">NGHTTP2_HCAT_REQUEST</span></tt>
containing request headers or <tt class="docutils literal"><span class="pre">NGHTTP2_HCAT_HEADERS</span></tt> containing
trailer headers and never get PUSH_PROMISE in this callback.</p>
<p>For the client applications, <tt class="docutils literal"><span class="pre">frame-&gt;hd.type</span></tt> is either
<tt class="docutils literal"><span class="pre">NGHTTP2_HEADERS</span></tt> or <tt class="docutils literal"><span class="pre">NGHTTP2_PUSH_PROMISE</span></tt>. In case of
<tt class="docutils literal"><span class="pre">NGHTTP2_HEADERS</span></tt>, <tt class="docutils literal"><span class="pre">frame-&gt;headers.cat</span> <span class="pre">==</span>
<span class="pre">NGHTTP2_HCAT_RESPONSE</span></tt> means that it is the first response
headers, but it may be non-final response which is indicated by 1xx
status code. In this case, there may be zero or more HEADERS frame
with <tt class="docutils literal"><span class="pre">frame-&gt;headers.cat</span> <span class="pre">==</span> <span class="pre">NGHTTP2_HCAT_HEADERS</span></tt> which has
non-final response code and finally client gets exactly one HEADERS
frame with <tt class="docutils literal"><span class="pre">frame-&gt;headers.cat</span> <span class="pre">==</span> <span class="pre">NGHTTP2_HCAT_HEADERS</span></tt>
containing final response headers (non-1xx status code). The
trailer headers also has <tt class="docutils literal"><span class="pre">frame-&gt;headers.cat</span> <span class="pre">==</span>
<span class="pre">NGHTTP2_HCAT_HEADERS</span></tt> which does not containg any status code.</p>
<p>The implementation of this function must return 0 if it succeeds or
<a class="reference internal" href="#c.NGHTTP2_ERR_CALLBACK_FAILURE" title="NGHTTP2_ERR_CALLBACK_FAILURE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_CALLBACK_FAILURE</span></tt></a>. If nonzero value other than
<a class="reference internal" href="#c.NGHTTP2_ERR_CALLBACK_FAILURE" title="NGHTTP2_ERR_CALLBACK_FAILURE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_CALLBACK_FAILURE</span></tt></a> is returned, it is treated as
@ -1869,7 +2006,8 @@ The <em>value</em> of length <em>valuelen</em> is header value. The <em>flags</
bitwise OR of one or more of <a class="reference internal" href="#c.nghttp2_nv_flag" title="nghttp2_nv_flag"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_nv_flag</span></tt></a>.</p>
<p>If <a class="reference internal" href="#c.NGHTTP2_NV_FLAG_NO_INDEX" title="NGHTTP2_NV_FLAG_NO_INDEX"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_NV_FLAG_NO_INDEX</span></tt></a> is set in <em>flags</em>, the receiver
must not index this name/value pair when forwarding it to the next
hop.</p>
hop. More specifically, &quot;Literal Header Field never Indexed&quot;
representation must be used in HPACK encoding.</p>
<p>When this callback is invoked, <tt class="docutils literal"><span class="pre">frame-&gt;hd.type</span></tt> is either
<a class="reference internal" href="#c.NGHTTP2_HEADERS" title="NGHTTP2_HEADERS"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_HEADERS</span></tt></a> or <a class="reference internal" href="#c.NGHTTP2_PUSH_PROMISE" title="NGHTTP2_PUSH_PROMISE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_PUSH_PROMISE</span></tt></a>. After all
header name/value pairs are processed with this callback, and no
@ -1877,19 +2015,13 @@ error has been detected, <a class="reference internal" href="#c.nghttp2_on_frame
will be invoked. If there is an error in decompression,
<a class="reference internal" href="#c.nghttp2_on_frame_recv_callback" title="nghttp2_on_frame_recv_callback"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_on_frame_recv_callback</span></tt></a> for the <em>frame</em> will not be
invoked.</p>
<p>The <em>name</em> may be <tt class="docutils literal"><span class="pre">NULL</span></tt> if the <em>namelen</em> is 0. The same thing
can be said about the <em>value</em>.</p>
<p>Please note that nghttp2 library does not perform any validity
check against the <em>name</em> and the <em>value</em>. For example, the
<em>namelen</em> could be 0, and/or the <em>value</em> contains <tt class="docutils literal"><span class="pre">0x0a</span></tt> or
<tt class="docutils literal"><span class="pre">0x0d</span></tt>. The application must check them if it matters. The
helper function <a class="reference internal" href="#c.nghttp2_check_header_name" title="nghttp2_check_header_name"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_check_header_name()</span></tt></a> and
<a class="reference internal" href="#c.nghttp2_check_header_value" title="nghttp2_check_header_value"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_check_header_value()</span></tt></a> provide simple validation against
HTTP2 header field construction rule.</p>
<p>HTTP/2 specification requires that pseudo header fields (header
field starting with ':') must appear in front of regular header
fields. The library does not validate this requirement. The
application must check them if it matters.</p>
<p>The <em>value</em> may be <tt class="docutils literal"><span class="pre">NULL</span></tt> if the <em>valuelen</em> is 0.</p>
<p>Please note that unless <a class="reference internal" href="#c.nghttp2_option_set_no_http_messaging" title="nghttp2_option_set_no_http_messaging"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_option_set_no_http_messaging()</span></tt></a> is
used, nghttp2 library does perform validation against the <em>name</em>
and the <em>value</em> using <a class="reference internal" href="#c.nghttp2_check_header_name" title="nghttp2_check_header_name"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_check_header_name()</span></tt></a> and
<a class="reference internal" href="#c.nghttp2_check_header_value" title="nghttp2_check_header_value"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_check_header_value()</span></tt></a>. In addition to this, nghttp2
performs vaidation based on HTTP Messaging rule, which is briefly
explained in <a class="reference internal" href="#http-messaging">HTTP Messaging</a> section.</p>
<p>If the application uses <a class="reference internal" href="#c.nghttp2_session_mem_recv" title="nghttp2_session_mem_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_mem_recv()</span></tt></a>, it can return
<a class="reference internal" href="#c.NGHTTP2_ERR_PAUSE" title="NGHTTP2_ERR_PAUSE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_PAUSE</span></tt></a> to make <a class="reference internal" href="#c.nghttp2_session_mem_recv" title="nghttp2_session_mem_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_mem_recv()</span></tt></a>
return without processing further input bytes. The memory pointed
@ -2291,6 +2423,16 @@ one, <a class="reference internal" href="#c.nghttp2_session_recv" title="nghttp2
return error <a class="reference internal" href="#c.NGHTTP2_ERR_BAD_PREFACE" title="NGHTTP2_ERR_BAD_PREFACE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_BAD_PREFACE</span></tt></a>, which is fatal error.</p>
</dd></dl>
<dl class="function">
<dt id="c.nghttp2_option_set_no_http_messaging">
void <tt class="descname">nghttp2_option_set_no_http_messaging</tt><big>(</big><a class="reference internal" href="#c.nghttp2_option" title="nghttp2_option">nghttp2_option</a><em>&nbsp;*option</em>, int<em>&nbsp;val</em><big>)</big><a class="headerlink" href="#c.nghttp2_option_set_no_http_messaging" title="Permalink to this definition"></a></dt>
<dd><p>By default, nghttp2 library enforces subset of HTTP Messaging rules
described in <a class="reference external" href="https://tools.ietf.org/html/draft-ietf-httpbis-http2-17#section-8">HTTP/2 specification, section 8</a>.
See <a class="reference internal" href="#http-messaging">HTTP Messaging</a> section for details. For those applications
who use nghttp2 library as non-HTTP use, give nonzero to <em>val</em> to
disable this enforcement.</p>
</dd></dl>
<dl class="function">
<dt id="c.nghttp2_session_client_new">
int <tt class="descname">nghttp2_session_client_new</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;**session_ptr</em>, const <a class="reference internal" href="#c.nghttp2_session_callbacks" title="nghttp2_session_callbacks">nghttp2_session_callbacks</a><em>&nbsp;*callbacks</em>, void<em>&nbsp;*user_data</em><big>)</big><a class="headerlink" href="#c.nghttp2_session_client_new" title="Permalink to this definition"></a></dt>
@ -3043,6 +3185,46 @@ to commit response twice.</p>
</div>
</dd></dl>
<dl class="function">
<dt id="c.nghttp2_submit_trailer">
int <tt class="descname">nghttp2_submit_trailer</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, int32_t<em>&nbsp;stream_id</em>, const <a class="reference internal" href="#c.nghttp2_nv" title="nghttp2_nv">nghttp2_nv</a><em>&nbsp;*nva</em>, size_t<em>&nbsp;nvlen</em><big>)</big><a class="headerlink" href="#c.nghttp2_submit_trailer" title="Permalink to this definition"></a></dt>
<dd><p>Submits trailer HEADERS against the stream <em>stream_id</em>.</p>
<p>The <em>nva</em> is an array of name/value pair <a class="reference internal" href="#c.nghttp2_nv" title="nghttp2_nv"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_nv</span></tt></a> with
<em>nvlen</em> elements. The application is responsible not to include
required pseudo-header fields (header field whose name starts with
&quot;:&quot;) in <em>nva</em>.</p>
<p>This function creates copies of all name/value pairs in <em>nva</em>. It
also lower-cases all names in <em>nva</em>. The order of elements in
<em>nva</em> is preserved.</p>
<p>For server, trailer must be followed by response HEADERS or
response DATA. The library does not check that response HEADERS
has already sent and if <a class="reference internal" href="#c.nghttp2_submit_trailer" title="nghttp2_submit_trailer"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_submit_trailer()</span></tt></a> is called before
any response HEADERS submission (usually by
<a class="reference internal" href="#c.nghttp2_submit_response" title="nghttp2_submit_response"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_submit_response()</span></tt></a>), the content of <em>nva</em> will be sent as
reponse headers, which will result in error.</p>
<p>This function has the same effect with <a class="reference internal" href="#c.nghttp2_submit_headers" title="nghttp2_submit_headers"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_submit_headers()</span></tt></a>,
with flags = <a class="reference internal" href="#c.NGHTTP2_FLAG_END_HEADERS" title="NGHTTP2_FLAG_END_HEADERS"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_FLAG_END_HEADERS</span></tt></a> and both pri_spec and
stream_user_data to NULL.</p>
<p>To submit trailer after <a class="reference internal" href="#c.nghttp2_submit_response" title="nghttp2_submit_response"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_submit_response()</span></tt></a> is called, the
application has to specify <a class="reference internal" href="#c.nghttp2_data_provider" title="nghttp2_data_provider"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_data_provider</span></tt></a> to
<a class="reference internal" href="#c.nghttp2_submit_response" title="nghttp2_submit_response"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_submit_response()</span></tt></a>. In side
<a class="reference internal" href="#c.nghttp2_data_source_read_callback" title="nghttp2_data_source_read_callback"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_data_source_read_callback</span></tt></a>, when setting
<a class="reference internal" href="#c.NGHTTP2_DATA_FLAG_EOF" title="NGHTTP2_DATA_FLAG_EOF"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_DATA_FLAG_EOF</span></tt></a>, also set
<a class="reference internal" href="#c.NGHTTP2_DATA_FLAG_NO_END_STREAM" title="NGHTTP2_DATA_FLAG_NO_END_STREAM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_DATA_FLAG_NO_END_STREAM</span></tt></a>. After that, the
application can send trailer using <a class="reference internal" href="#c.nghttp2_submit_trailer" title="nghttp2_submit_trailer"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_submit_trailer()</span></tt></a>.
<a class="reference internal" href="#c.nghttp2_submit_trailer" title="nghttp2_submit_trailer"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_submit_trailer()</span></tt></a> can be used inside
<a class="reference internal" href="#c.nghttp2_data_source_read_callback" title="nghttp2_data_source_read_callback"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_data_source_read_callback</span></tt></a>.</p>
<p>This function returns 0 if it succeeds and <em>stream_id</em> is -1.
Otherwise, this function returns 0 if it succeeds, or one of the
following negative error codes:</p>
<dl class="docutils">
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_NOMEM" title="NGHTTP2_ERR_NOMEM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_NOMEM</span></tt></a></dt>
<dd>Out of memory.</dd>
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_INVALID_ARGUMENT" title="NGHTTP2_ERR_INVALID_ARGUMENT"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_INVALID_ARGUMENT</span></tt></a></dt>
<dd>The <em>stream_id</em> is 0.</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="c.nghttp2_submit_headers">
int32_t <tt class="descname">nghttp2_submit_headers</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, uint8_t<em>&nbsp;flags</em>, int32_t<em>&nbsp;stream_id</em>, const <a class="reference internal" href="#c.nghttp2_priority_spec" title="nghttp2_priority_spec">nghttp2_priority_spec</a><em>&nbsp;*pri_spec</em>, const <a class="reference internal" href="#c.nghttp2_nv" title="nghttp2_nv">nghttp2_nv</a><em>&nbsp;*nva</em>, size_t<em>&nbsp;nvlen</em>, void<em>&nbsp;*stream_user_data</em><big>)</big><a class="headerlink" href="#c.nghttp2_submit_headers" title="Permalink to this definition"></a></dt>
@ -3239,6 +3421,8 @@ make it in reserved state. It is available using
access it in <a class="reference internal" href="#c.nghttp2_before_frame_send_callback" title="nghttp2_before_frame_send_callback"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_before_frame_send_callback</span></tt></a> and
<a class="reference internal" href="#c.nghttp2_on_frame_send_callback" title="nghttp2_on_frame_send_callback"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_on_frame_send_callback</span></tt></a> of this frame.</p>
<p>The client side is not allowed to use this function.</p>
<p>To submit response headers and data, use
<a class="reference internal" href="#c.nghttp2_submit_response" title="nghttp2_submit_response"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_submit_response()</span></tt></a>.</p>
<p>This function returns assigned promised stream ID if it succeeds,
or one of the following negative error codes:</p>
<dl class="docutils">
@ -3728,7 +3912,7 @@ always succeeds.</p>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.7.2-DEV',
VERSION:'0.7.8-DEV',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: false

View File

@ -7,7 +7,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>asio_http2.h &mdash; nghttp2 0.7.2-DEV documentation</title>
<title>asio_http2.h &mdash; nghttp2 0.7.8-DEV documentation</title>
@ -28,8 +28,8 @@
<link rel="top" title="nghttp2 0.7.2-DEV documentation" href="index.html"/>
<link rel="prev" title="nghttp2ver.h" href="nghttp2ver.h.html"/>
<link rel="top" title="nghttp2 0.7.8-DEV documentation" href="index.html"/>
<link rel="prev" title="asio_http2_client.h" href="asio_http2_client.h.html"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
@ -99,30 +99,33 @@
<li class="toctree-l1"><a class="reference internal" href="nghttp.1.html">nghttp(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpd.1.html">nghttpd(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpx.1.html">nghttpx(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#files">FILES</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#signals">SIGNALS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#server-push">SERVER PUSH</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#unix-domain-socket">UNIX DOMAIN SOCKET</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load.1.html">h2load(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#output">OUTPUT</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
@ -138,7 +141,7 @@
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#rewriting-location-header-field">Rewriting location header field</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#hot-swapping">Hot swapping</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#re-opening-log-files">Re-opening log files</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-http-1-backend-addresses">Multiple HTTP/1 backend addresses</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-backend-addresses">Multiple backend addresses</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load-howto.html">h2load - HTTP/2 benchmarking tool - HOW-TO</a><ul>
@ -152,6 +155,7 @@
<li class="toctree-l1"><a class="reference internal" href="apiref.html">API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#includes">Includes</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#remarks">Remarks</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#http-messaging">HTTP Messaging</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#macros">Macros</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#enums">Enums</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#types-structs-unions-and-typedefs">Types (structs, unions and typedefs)</a></li>
@ -160,6 +164,7 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="libnghttp2_asio.html">libnghttp2_asio: High level HTTP/2 C++ library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#server-api">Server API</a></li>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#client-api">Client API</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="python-apiref.html">Python API Reference</a><ul>
@ -169,6 +174,8 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2.h.html">nghttp2.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2ver.h.html">nghttp2ver.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_server.h.html">asio_http2_server.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_client.h.html">asio_http2_client.h</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="">asio_http2.h</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2">Source</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2/issues">Issues</a></li>
@ -240,205 +247,86 @@
<span class="cp">#include &lt;string&gt;</span>
<span class="cp">#include &lt;vector&gt;</span>
<span class="cp">#include &lt;functional&gt;</span>
<span class="cp">#include &lt;map&gt;</span>
<span class="cp">#include &lt;boost/system/error_code.hpp&gt;</span>
<span class="cp">#include &lt;boost/asio.hpp&gt;</span>
<span class="cp">#include &lt;boost/asio/ssl.hpp&gt;</span>
<span class="cp">#include &lt;nghttp2/nghttp2.h&gt;</span>
<span class="k">namespace</span> <span class="n">boost</span> <span class="p">{</span>
<span class="k">namespace</span> <span class="n">system</span> <span class="p">{</span>
<span class="k">template</span> <span class="o">&lt;&gt;</span> <span class="k">struct</span> <span class="n">is_error_code_enum</span><span class="o">&lt;</span><span class="n">nghttp2_error</span><span class="o">&gt;</span> <span class="p">{</span>
<span class="n">BOOST_STATIC_CONSTANT</span><span class="p">(</span><span class="kt">bool</span><span class="p">,</span> <span class="n">value</span> <span class="o">=</span> <span class="nb">true</span><span class="p">);</span>
<span class="p">};</span>
<span class="p">}</span> <span class="c1">// namespace system</span>
<span class="p">}</span> <span class="c1">// namespace boost</span>
<span class="k">namespace</span> <span class="n">nghttp2</span> <span class="p">{</span>
<span class="k">namespace</span> <span class="n">asio_http2</span> <span class="p">{</span>
<span class="k">struct</span> <span class="n">header</span> <span class="p">{</span>
<span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">name</span><span class="p">;</span>
<span class="k">struct</span> <span class="n">header_value</span> <span class="p">{</span>
<span class="c1">// header field value</span>
<span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">value</span><span class="p">;</span>
<span class="c1">// true if the header field value is sensitive information, such as</span>
<span class="c1">// authorization information or short length secret cookies. If</span>
<span class="c1">// true, those header fields are not indexed by HPACK (but still</span>
<span class="c1">// huffman-encoded), which results in lesser compression.</span>
<span class="kt">bool</span> <span class="n">sensitive</span><span class="p">;</span>
<span class="p">};</span>
<span class="c1">// header fields. The header field name must be lower-cased.</span>
<span class="k">using</span> <span class="n">header_map</span> <span class="o">=</span> <span class="n">std</span><span class="o">::</span><span class="n">multimap</span><span class="o">&lt;</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="p">,</span> <span class="n">header_value</span><span class="o">&gt;</span><span class="p">;</span>
<span class="k">const</span> <span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_category</span> <span class="o">&amp;</span><span class="n">nghttp2_category</span><span class="p">()</span> <span class="k">noexcept</span><span class="p">;</span>
<span class="k">struct</span> <span class="n">uri_ref</span> <span class="p">{</span>
<span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">scheme</span><span class="p">;</span>
<span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">host</span><span class="p">;</span>
<span class="c1">// form after percent-encoding decoded</span>
<span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">path</span><span class="p">;</span>
<span class="c1">// original path, percent-encoded</span>
<span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">raw_path</span><span class="p">;</span>
<span class="c1">// original query, percent-encoded</span>
<span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">raw_query</span><span class="p">;</span>
<span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">fragment</span><span class="p">;</span>
<span class="p">};</span>
<span class="c1">// Callback function when data is arrived. EOF is indicated by</span>
<span class="c1">// passing 0 to the second parameter.</span>
<span class="k">typedef</span> <span class="n">std</span><span class="o">::</span><span class="n">function</span><span class="o">&lt;</span><span class="kt">void</span><span class="p">(</span><span class="k">const</span> <span class="kt">uint8_t</span> <span class="o">*</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="kt">size_t</span><span class="p">)</span><span class="o">&gt;</span> <span class="n">data_cb</span><span class="p">;</span>
<span class="k">typedef</span> <span class="n">std</span><span class="o">::</span><span class="n">function</span><span class="o">&lt;</span><span class="kt">void</span><span class="p">(</span><span class="kt">void</span><span class="p">)</span><span class="o">&gt;</span> <span class="n">void_cb</span><span class="p">;</span>
<span class="k">typedef</span> <span class="n">std</span><span class="o">::</span><span class="n">function</span><span class="o">&lt;</span><span class="kt">void</span><span class="p">(</span><span class="k">const</span> <span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_code</span> <span class="o">&amp;</span><span class="n">ec</span><span class="p">)</span><span class="o">&gt;</span> <span class="n">error_cb</span><span class="p">;</span>
<span class="c1">// Callback function when request and response are finished. The</span>
<span class="c1">// parameter indicates the cause of closure.</span>
<span class="k">typedef</span> <span class="n">std</span><span class="o">::</span><span class="n">function</span><span class="o">&lt;</span><span class="kt">void</span><span class="p">(</span><span class="kt">uint32_t</span><span class="p">)</span><span class="o">&gt;</span> <span class="n">close_cb</span><span class="p">;</span>
<span class="c1">// Callback function to generate response body. The implementation of</span>
<span class="c1">// this callback must fill at most |len| bytes data to |buf|. The</span>
<span class="c1">// return value is pair of written bytes and bool value indicating</span>
<span class="c1">// that this is the end of the body. If the end of the body was</span>
<span class="c1">// reached, return true. If there is error and application wants to</span>
<span class="c1">// terminate stream, return std::make_pair(-1, false). Returning</span>
<span class="c1">// std::make_pair(0, false) tells the library that don&#39;t call this</span>
<span class="c1">// callback until application calls response::resume(). This is</span>
<span class="c1">// useful when there is no data to send at the moment but there will</span>
<span class="c1">// be more to come in near future.</span>
<span class="k">typedef</span> <span class="n">std</span><span class="o">::</span><span class="n">function</span><span class="o">&lt;</span><span class="n">std</span><span class="o">::</span><span class="n">pair</span><span class="o">&lt;</span><span class="kt">ssize_t</span><span class="p">,</span> <span class="kt">bool</span><span class="o">&gt;</span><span class="p">(</span><span class="kt">uint8_t</span> <span class="o">*</span><span class="n">buf</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="kt">size_t</span> <span class="n">len</span><span class="p">)</span><span class="o">&gt;</span>
<span class="n">read_cb</span><span class="p">;</span>
<span class="k">class</span> <span class="nc">channel_impl</span><span class="p">;</span>
<span class="k">class</span> <span class="nc">channel</span> <span class="p">{</span>
<span class="k">public</span><span class="o">:</span>
<span class="c1">// Application must not call this directly.</span>
<span class="n">channel</span><span class="p">();</span>
<span class="c1">// Schedules the execution of callback |cb| in the same thread where</span>
<span class="c1">// request callback is called. Therefore, it is same to use request</span>
<span class="c1">// or response object in |cb|. The callbacks are executed in the</span>
<span class="c1">// same order they are posted though same channel object if they are</span>
<span class="c1">// posted from the same thread.</span>
<span class="kt">void</span> <span class="nf">post</span><span class="p">(</span><span class="n">void_cb</span> <span class="n">cb</span><span class="p">);</span>
<span class="c1">// Application must not call this directly.</span>
<span class="n">channel_impl</span> <span class="o">&amp;</span><span class="n">impl</span><span class="p">();</span>
<span class="k">private</span><span class="o">:</span>
<span class="n">std</span><span class="o">::</span><span class="n">unique_ptr</span><span class="o">&lt;</span><span class="n">channel_impl</span><span class="o">&gt;</span> <span class="n">impl_</span><span class="p">;</span>
<span class="p">};</span>
<span class="k">typedef</span> <span class="n">std</span><span class="o">::</span><span class="n">function</span><span class="o">&lt;</span><span class="kt">void</span><span class="p">(</span><span class="n">channel</span> <span class="o">&amp;</span><span class="p">)</span><span class="o">&gt;</span> <span class="n">thread_cb</span><span class="p">;</span>
<span class="k">namespace</span> <span class="n">server</span> <span class="p">{</span>
<span class="k">class</span> <span class="nc">request_impl</span><span class="p">;</span>
<span class="k">class</span> <span class="nc">response_impl</span><span class="p">;</span>
<span class="k">class</span> <span class="nc">request</span> <span class="p">{</span>
<span class="k">public</span><span class="o">:</span>
<span class="c1">// Application must not call this directly.</span>
<span class="n">request</span><span class="p">();</span>
<span class="c1">// Returns request headers. The pusedo headers, which start with</span>
<span class="c1">// colon (;), are exluced from this list.</span>
<span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">header</span><span class="o">&gt;</span> <span class="o">&amp;</span><span class="n">headers</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Returns method (e.g., GET).</span>
<span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&amp;</span><span class="n">method</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Returns scheme (e.g., https).</span>
<span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&amp;</span><span class="n">scheme</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Returns authority (e.g., example.org). This could be empty</span>
<span class="c1">// string. In this case, check host().</span>
<span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&amp;</span><span class="n">authority</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Returns host (e.g., example.org). If host header field is not</span>
<span class="c1">// present, this value is copied from authority().</span>
<span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&amp;</span><span class="n">host</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Returns path (e.g., /index.html).</span>
<span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&amp;</span><span class="n">path</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Sets callback when chunk of request body is received.</span>
<span class="kt">void</span> <span class="nf">on_data</span><span class="p">(</span><span class="n">data_cb</span> <span class="n">cb</span><span class="p">);</span>
<span class="c1">// Sets callback when request was completed.</span>
<span class="kt">void</span> <span class="nf">on_end</span><span class="p">(</span><span class="n">void_cb</span> <span class="n">cb</span><span class="p">);</span>
<span class="c1">// Pushes resource denoted by |path| using |method|. The additional</span>
<span class="c1">// headers can be given in |headers|. request_cb will be called for</span>
<span class="c1">// pushed resource later on. This function returns true if it</span>
<span class="c1">// succeeds, or false.</span>
<span class="kt">bool</span> <span class="nf">push</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">method</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">path</span><span class="p">,</span>
<span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">header</span><span class="o">&gt;</span> <span class="n">headers</span> <span class="o">=</span> <span class="p">{});</span>
<span class="c1">// Returns true if this is pushed request.</span>
<span class="kt">bool</span> <span class="n">pushed</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Returns true if stream has been closed.</span>
<span class="kt">bool</span> <span class="n">closed</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Runs function |start| in one of background threads. Returns true</span>
<span class="c1">// if scheduling task was done successfully.</span>
<span class="c1">//</span>
<span class="c1">// Since |start| is called in different thread, calling any method</span>
<span class="c1">// of request or response object in the callback may cause undefined</span>
<span class="c1">// behavior. To safely use them, use channel::post(). A callback</span>
<span class="c1">// passed to channel::post() is executed in the same thread where</span>
<span class="c1">// request callback is called, so it is safe to use request or</span>
<span class="c1">// response object. Example::</span>
<span class="kt">bool</span> <span class="nf">run_task</span><span class="p">(</span><span class="n">thread_cb</span> <span class="n">start</span><span class="p">);</span>
<span class="c1">// Application must not call this directly.</span>
<span class="n">request_impl</span> <span class="o">&amp;</span><span class="n">impl</span><span class="p">();</span>
<span class="k">private</span><span class="o">:</span>
<span class="n">std</span><span class="o">::</span><span class="n">unique_ptr</span><span class="o">&lt;</span><span class="n">request_impl</span><span class="o">&gt;</span> <span class="n">impl_</span><span class="p">;</span>
<span class="p">};</span>
<span class="k">class</span> <span class="nc">response</span> <span class="p">{</span>
<span class="k">public</span><span class="o">:</span>
<span class="c1">// Application must not call this directly.</span>
<span class="n">response</span><span class="p">();</span>
<span class="c1">// Write response header using |status_code| (e.g., 200) and</span>
<span class="c1">// additional headers in |headers|.</span>
<span class="kt">void</span> <span class="nf">write_head</span><span class="p">(</span><span class="kt">unsigned</span> <span class="kt">int</span> <span class="n">status_code</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">header</span><span class="o">&gt;</span> <span class="n">headers</span> <span class="o">=</span> <span class="p">{});</span>
<span class="c1">// Sends |data| as request body. No further call of end() is</span>
<span class="c1">// allowed.</span>
<span class="kt">void</span> <span class="nf">end</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">data</span> <span class="o">=</span> <span class="s">&quot;&quot;</span><span class="p">);</span>
<span class="c1">// Sets callback |cb| as a generator of the response body. No</span>
<span class="c1">// further call of end() is allowed.</span>
<span class="kt">void</span> <span class="nf">end</span><span class="p">(</span><span class="n">read_cb</span> <span class="n">cb</span><span class="p">);</span>
<span class="c1">// Resumes deferred response.</span>
<span class="kt">void</span> <span class="nf">resume</span><span class="p">();</span>
<span class="c1">// Returns status code.</span>
<span class="kt">unsigned</span> <span class="kt">int</span> <span class="n">status_code</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Returns true if response has been started.</span>
<span class="kt">bool</span> <span class="n">started</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Application must not call this directly.</span>
<span class="n">response_impl</span> <span class="o">&amp;</span><span class="n">impl</span><span class="p">();</span>
<span class="k">private</span><span class="o">:</span>
<span class="n">std</span><span class="o">::</span><span class="n">unique_ptr</span><span class="o">&lt;</span><span class="n">response_impl</span><span class="o">&gt;</span> <span class="n">impl_</span><span class="p">;</span>
<span class="p">};</span>
<span class="c1">// This is so called request callback. Called every time request is</span>
<span class="c1">// received.</span>
<span class="k">typedef</span> <span class="n">std</span><span class="o">::</span><span class="n">function</span><span class="o">&lt;</span><span class="kt">void</span><span class="p">(</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">shared_ptr</span><span class="o">&lt;</span><span class="n">request</span><span class="o">&gt;</span> <span class="o">&amp;</span><span class="p">,</span>
<span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">shared_ptr</span><span class="o">&lt;</span><span class="n">response</span><span class="o">&gt;</span> <span class="o">&amp;</span><span class="p">)</span><span class="o">&gt;</span> <span class="n">request_cb</span><span class="p">;</span>
<span class="k">class</span> <span class="nc">http2_impl</span><span class="p">;</span>
<span class="k">class</span> <span class="nc">http2</span> <span class="p">{</span>
<span class="k">public</span><span class="o">:</span>
<span class="n">http2</span><span class="p">();</span>
<span class="o">~</span><span class="n">http2</span><span class="p">();</span>
<span class="c1">// Starts listening connection on given address and port. The</span>
<span class="c1">// incoming requests are handled by given callback |cb|.</span>
<span class="kt">void</span> <span class="nf">listen</span><span class="p">(</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&amp;</span><span class="n">address</span><span class="p">,</span> <span class="kt">uint16_t</span> <span class="n">port</span><span class="p">,</span> <span class="n">request_cb</span> <span class="n">cb</span><span class="p">);</span>
<span class="c1">// Sets number of native threads to handle incoming HTTP request.</span>
<span class="c1">// It defaults to 1.</span>
<span class="kt">void</span> <span class="nf">num_threads</span><span class="p">(</span><span class="kt">size_t</span> <span class="n">num_threads</span><span class="p">);</span>
<span class="c1">// Sets TLS private key file and certificate file. Both files must</span>
<span class="c1">// be in PEM format.</span>
<span class="kt">void</span> <span class="nf">tls</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">private_key_file</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">certificate_file</span><span class="p">);</span>
<span class="c1">// Sets number of background threads to run concurrent tasks (see</span>
<span class="c1">// request::run_task()). It defaults to 1. This is not the number</span>
<span class="c1">// of thread to handle incoming HTTP request. For this purpose, see</span>
<span class="c1">// num_threads().</span>
<span class="kt">void</span> <span class="nf">num_concurrent_tasks</span><span class="p">(</span><span class="kt">size_t</span> <span class="n">num_concurrent_tasks</span><span class="p">);</span>
<span class="c1">// Sets the maximum length to which the queue of pending</span>
<span class="c1">// connections.</span>
<span class="kt">void</span> <span class="nf">backlog</span><span class="p">(</span><span class="kt">int</span> <span class="n">backlog</span><span class="p">);</span>
<span class="k">private</span><span class="o">:</span>
<span class="n">std</span><span class="o">::</span><span class="n">unique_ptr</span><span class="o">&lt;</span><span class="n">http2_impl</span><span class="o">&gt;</span> <span class="n">impl_</span><span class="p">;</span>
<span class="p">};</span>
<span class="p">}</span> <span class="c1">// namespace server</span>
<span class="c1">// Callback function to generate response body. This function has the</span>
<span class="c1">// same semantics with nghttp2_data_source_read_callback. Just source</span>
<span class="c1">// and user_data parameters are removed.</span>
<span class="c1">//</span>
<span class="c1">// Basically, write at most |len| bytes to |data| and returns the</span>
<span class="c1">// number of bytes written. If there is no data left to send, set</span>
<span class="c1">// NGHTTP2_DATA_FLAG_EOF to *data_flags (e.g., *data_flags |=</span>
<span class="c1">// NGHTTP2_DATA_FLAG_EOF). If there is still data to send but they</span>
<span class="c1">// are not available right now, return NGHTTP2_ERR_DEFERRED. In case</span>
<span class="c1">// of the error and request/response must be closed, return</span>
<span class="c1">// NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE.</span>
<span class="k">typedef</span> <span class="n">std</span><span class="o">::</span><span class="n">function</span><span class="o">&lt;</span>
<span class="kt">ssize_t</span><span class="p">(</span><span class="kt">uint8_t</span> <span class="o">*</span><span class="n">buf</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="kt">size_t</span> <span class="n">len</span><span class="p">,</span> <span class="kt">uint32_t</span> <span class="o">*</span><span class="n">data_flags</span><span class="p">)</span><span class="o">&gt;</span> <span class="n">generator_cb</span><span class="p">;</span>
<span class="c1">// Convenient function to create function to read file denoted by</span>
<span class="c1">// |path|. This can be passed to response::end().</span>
<span class="n">read_cb</span> <span class="n">file_reader</span><span class="p">(</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&amp;</span><span class="n">path</span><span class="p">);</span>
<span class="n">generator_cb</span> <span class="nf">file_generator</span><span class="p">(</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&amp;</span><span class="n">path</span><span class="p">);</span>
<span class="c1">// Like file_reader(const std::string&amp;), but it takes opened file</span>
<span class="c1">// Like file_generator(const std::string&amp;), but it takes opened file</span>
<span class="c1">// descriptor. The passed descriptor will be closed when returned</span>
<span class="c1">// function object is destroyed.</span>
<span class="n">read_cb</span> <span class="nf">file_reader_from_fd</span><span class="p">(</span><span class="kt">int</span> <span class="n">fd</span><span class="p">);</span>
<span class="n">generator_cb</span> <span class="nf">file_generator_from_fd</span><span class="p">(</span><span class="kt">int</span> <span class="n">fd</span><span class="p">);</span>
<span class="c1">// Validates path so that it does not contain directory traversal</span>
<span class="c1">// vector. Returns true if path is safe. The |path| must start with</span>
@ -452,6 +340,15 @@
<span class="c1">// Returns HTTP date representation of current posix time |t|.</span>
<span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">http_date</span><span class="p">(</span><span class="kt">int64_t</span> <span class="n">t</span><span class="p">);</span>
<span class="c1">// Parses |uri| and extract scheme, host and service. The service is</span>
<span class="c1">// port component of URI (e.g., &quot;8443&quot;) if available, otherwise it is</span>
<span class="c1">// scheme (e.g., &quot;https&quot;).</span>
<span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_code</span> <span class="n">host_service_from_uri</span><span class="p">(</span><span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_code</span> <span class="o">&amp;</span><span class="n">ec</span><span class="p">,</span>
<span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&amp;</span><span class="n">scheme</span><span class="p">,</span>
<span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&amp;</span><span class="n">host</span><span class="p">,</span>
<span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&amp;</span><span class="n">service</span><span class="p">,</span>
<span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&amp;</span><span class="n">uri</span><span class="p">);</span>
<span class="p">}</span> <span class="c1">// namespace asio_http2</span>
<span class="p">}</span> <span class="c1">// namespace nghttp2</span>
@ -468,7 +365,7 @@
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="nghttp2ver.h.html" class="btn btn-neutral" title="nghttp2ver.h"><span class="fa fa-arrow-circle-left"></span> Previous</a>
<a href="asio_http2_client.h.html" class="btn btn-neutral" title="asio_http2_client.h"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
@ -498,7 +395,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.7.2-DEV',
VERSION:'0.7.8-DEV',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: false

484
asio_http2_client.h.html Normal file
View File

@ -0,0 +1,484 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>asio_http2_client.h &mdash; nghttp2 0.7.8-DEV documentation</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="top" title="nghttp2 0.7.8-DEV documentation" href="index.html"/>
<link rel="next" title="asio_http2.h" href="asio_http2.h.html"/>
<link rel="prev" title="asio_http2_server.h" href="asio_http2_server.h.html"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="index.html" class="fa fa-home"> nghttp2</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="package_README.html">nghttp2 - HTTP/2 C Library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="package_README.html#development-status">Development Status</a></li>
<li class="toctree-l2"><a class="reference internal" href="package_README.html#public-test-server">Public Test Server</a></li>
<li class="toctree-l2"><a class="reference internal" href="package_README.html#requirements">Requirements</a></li>
<li class="toctree-l2"><a class="reference internal" href="package_README.html#build-from-git">Build from git</a></li>
<li class="toctree-l2"><a class="reference internal" href="package_README.html#building-documentation">Building documentation</a></li>
<li class="toctree-l2"><a class="reference internal" href="package_README.html#unit-tests">Unit tests</a></li>
<li class="toctree-l2"><a class="reference internal" href="package_README.html#integration-tests">Integration tests</a></li>
<li class="toctree-l2"><a class="reference internal" href="package_README.html#client-server-and-proxy-programs">Client, Server and Proxy programs</a></li>
<li class="toctree-l2"><a class="reference internal" href="package_README.html#benchmarking-tool">Benchmarking tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="package_README.html#hpack-tools">HPACK tools</a></li>
<li class="toctree-l2"><a class="reference internal" href="package_README.html#libnghttp2-asio-high-level-http-2-c-library">libnghttp2_asio: High level HTTP/2 C++ library</a></li>
<li class="toctree-l2"><a class="reference internal" href="package_README.html#python-bindings">Python bindings</a></li>
<li class="toctree-l2"><a class="reference internal" href="package_README.html#contribution">Contribution</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="contribute.html">Contribution Guidelines</a><ul>
<li class="toctree-l2"><a class="reference internal" href="contribute.html#coding-style">Coding style</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="building-android-binary.html">Building Android binary</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial-client.html">Tutorial: HTTP/2 client</a><ul>
<li class="toctree-l2"><a class="reference internal" href="tutorial-client.html#libevent-client-c">libevent-client.c</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="tutorial-server.html">Tutorial: HTTP/2 server</a><ul>
<li class="toctree-l2"><a class="reference internal" href="tutorial-server.html#libevent-server-c">libevent-server.c</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="tutorial-hpack.html">Tutorial: HPACK API</a><ul>
<li class="toctree-l2"><a class="reference internal" href="tutorial-hpack.html#deflating-encoding-headers">Deflating (encoding) headers</a></li>
<li class="toctree-l2"><a class="reference internal" href="tutorial-hpack.html#inflating-decoding-headers">Inflating (decoding) headers</a></li>
<li class="toctree-l2"><a class="reference internal" href="tutorial-hpack.html#deflate-c">deflate.c</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttp.1.html">nghttp(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpd.1.html">nghttpd(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpx.1.html">nghttpx(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#files">FILES</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#signals">SIGNALS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#server-push">SERVER PUSH</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#unix-domain-socket">UNIX DOMAIN SOCKET</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load.1.html">h2load(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#output">OUTPUT</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpx-howto.html">nghttpx - HTTP/2 proxy - HOW-TO</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#default-mode">Default mode</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#http-2-proxy-mode">HTTP/2 proxy mode</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#client-mode">Client mode</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#client-proxy-mode">Client proxy mode</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#http-2-bridge-mode">HTTP/2 bridge mode</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#disable-ssl-tls">Disable SSL/TLS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#specifying-additional-ca-certificate">Specifying additional CA certificate</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#read-write-rate-limit">Read/write rate limit</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#rewriting-location-header-field">Rewriting location header field</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#hot-swapping">Hot swapping</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#re-opening-log-files">Re-opening log files</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-backend-addresses">Multiple backend addresses</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load-howto.html">h2load - HTTP/2 benchmarking tool - HOW-TO</a><ul>
<li class="toctree-l2"><a class="reference internal" href="h2load-howto.html#basic-usage">Basic Usage</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load-howto.html#flow-control">Flow Control</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load-howto.html#multi-threading">Multi-Threading</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load-howto.html#selecting-protocol-for-clear-text">Selecting protocol for clear text</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load-howto.html#multiple-uris">Multiple URIs</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="apiref.html">API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#includes">Includes</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#remarks">Remarks</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#http-messaging">HTTP Messaging</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#macros">Macros</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#enums">Enums</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#types-structs-unions-and-typedefs">Types (structs, unions and typedefs)</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#functions">Functions</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="libnghttp2_asio.html">libnghttp2_asio: High level HTTP/2 C++ library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#server-api">Server API</a></li>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#client-api">Client API</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="python-apiref.html">Python API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="python-apiref.html#hpack-api">HPACK API</a></li>
<li class="toctree-l2"><a class="reference internal" href="python-apiref.html#http-2-servers">HTTP/2 servers</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2.h.html">nghttp2.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2ver.h.html">nghttp2ver.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_server.h.html">asio_http2_server.h</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="">asio_http2_client.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2.h.html">asio_http2.h</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2">Source</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2/issues">Issues</a></li>
<li class="toctree-l1"><a class="reference external" href="https://nghttp2.org/">nghttp2.org</a></li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">nghttp2</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> &raquo;</li>
<li>asio_http2_client.h</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document">
<div class="section" id="asio-http2-client-h">
<h1>asio_http2_client.h<a class="headerlink" href="#asio-http2-client-h" title="Permalink to this headline"></a></h1>
<div class="highlight-cpp"><div class="highlight"><pre><span class="cm">/*</span>
<span class="cm"> * nghttp2 - HTTP/2 C Library</span>
<span class="cm"> *</span>
<span class="cm"> * Copyright (c) 2015 Tatsuhiro Tsujikawa</span>
<span class="cm"> *</span>
<span class="cm"> * Permission is hereby granted, free of charge, to any person obtaining</span>
<span class="cm"> * a copy of this software and associated documentation files (the</span>
<span class="cm"> * &quot;Software&quot;), to deal in the Software without restriction, including</span>
<span class="cm"> * without limitation the rights to use, copy, modify, merge, publish,</span>
<span class="cm"> * distribute, sublicense, and/or sell copies of the Software, and to</span>
<span class="cm"> * permit persons to whom the Software is furnished to do so, subject to</span>
<span class="cm"> * the following conditions:</span>
<span class="cm"> *</span>
<span class="cm"> * The above copyright notice and this permission notice shall be</span>
<span class="cm"> * included in all copies or substantial portions of the Software.</span>
<span class="cm"> *</span>
<span class="cm"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,</span>
<span class="cm"> * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF</span>
<span class="cm"> * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND</span>
<span class="cm"> * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE</span>
<span class="cm"> * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION</span>
<span class="cm"> * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION</span>
<span class="cm"> * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</span>
<span class="cm"> */</span>
<span class="cp">#ifndef ASIO_HTTP2_CLIENT_H</span>
<span class="cp">#define ASIO_HTTP2_CLIENT_H</span>
<span class="cp">#include &lt;nghttp2/asio_http2.h&gt;</span>
<span class="k">namespace</span> <span class="n">nghttp2</span> <span class="p">{</span>
<span class="k">namespace</span> <span class="n">asio_http2</span> <span class="p">{</span>
<span class="k">namespace</span> <span class="n">client</span> <span class="p">{</span>
<span class="k">class</span> <span class="nc">response_impl</span><span class="p">;</span>
<span class="k">class</span> <span class="nc">response</span> <span class="p">{</span>
<span class="k">public</span><span class="o">:</span>
<span class="c1">// Application must not call this directly.</span>
<span class="n">response</span><span class="p">();</span>
<span class="o">~</span><span class="n">response</span><span class="p">();</span>
<span class="c1">// Sets callback which is invoked when chunk of response body is</span>
<span class="c1">// received.</span>
<span class="kt">void</span> <span class="n">on_data</span><span class="p">(</span><span class="n">data_cb</span> <span class="n">cb</span><span class="p">)</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Returns status code.</span>
<span class="kt">int</span> <span class="n">status_code</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Returns content-length. -1 if it is unknown.</span>
<span class="kt">int64_t</span> <span class="n">content_length</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Returns the response header fields. The pusedo header fields,</span>
<span class="c1">// which start with colon (:), are exluced from this list.</span>
<span class="k">const</span> <span class="n">header_map</span> <span class="o">&amp;</span><span class="n">header</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Application must not call this directly.</span>
<span class="n">response_impl</span> <span class="o">&amp;</span><span class="n">impl</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span>
<span class="k">private</span><span class="o">:</span>
<span class="n">std</span><span class="o">::</span><span class="n">unique_ptr</span><span class="o">&lt;</span><span class="n">response_impl</span><span class="o">&gt;</span> <span class="n">impl_</span><span class="p">;</span>
<span class="p">};</span>
<span class="k">class</span> <span class="nc">request</span><span class="p">;</span>
<span class="k">using</span> <span class="n">response_cb</span> <span class="o">=</span> <span class="n">std</span><span class="o">::</span><span class="n">function</span><span class="o">&lt;</span><span class="kt">void</span><span class="p">(</span><span class="k">const</span> <span class="n">response</span> <span class="o">&amp;</span><span class="p">)</span><span class="o">&gt;</span><span class="p">;</span>
<span class="k">using</span> <span class="n">request_cb</span> <span class="o">=</span> <span class="n">std</span><span class="o">::</span><span class="n">function</span><span class="o">&lt;</span><span class="kt">void</span><span class="p">(</span><span class="k">const</span> <span class="n">request</span> <span class="o">&amp;</span><span class="p">)</span><span class="o">&gt;</span><span class="p">;</span>
<span class="k">using</span> <span class="n">connect_cb</span> <span class="o">=</span>
<span class="n">std</span><span class="o">::</span><span class="n">function</span><span class="o">&lt;</span><span class="kt">void</span><span class="p">(</span><span class="n">boost</span><span class="o">::</span><span class="n">asio</span><span class="o">::</span><span class="n">ip</span><span class="o">::</span><span class="n">tcp</span><span class="o">::</span><span class="n">resolver</span><span class="o">::</span><span class="n">iterator</span><span class="p">)</span><span class="o">&gt;</span><span class="p">;</span>
<span class="k">class</span> <span class="nc">request_impl</span><span class="p">;</span>
<span class="k">class</span> <span class="nc">request</span> <span class="p">{</span>
<span class="k">public</span><span class="o">:</span>
<span class="c1">// Application must not call this directly.</span>
<span class="n">request</span><span class="p">();</span>
<span class="o">~</span><span class="n">request</span><span class="p">();</span>
<span class="c1">// Sets callback which is invoked when response header is received.</span>
<span class="kt">void</span> <span class="n">on_response</span><span class="p">(</span><span class="n">response_cb</span> <span class="n">cb</span><span class="p">)</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Sets callback which is invoked when push request header is</span>
<span class="c1">// received.</span>
<span class="kt">void</span> <span class="n">on_push</span><span class="p">(</span><span class="n">request_cb</span> <span class="n">cb</span><span class="p">)</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Sets callback which is invoked when this request and response are</span>
<span class="c1">// finished. After the invocation of this callback, the application</span>
<span class="c1">// must not access request and response object.</span>
<span class="kt">void</span> <span class="n">on_close</span><span class="p">(</span><span class="n">close_cb</span> <span class="n">cb</span><span class="p">)</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Write trailer part. This must be called after setting both</span>
<span class="c1">// NGHTTP2_DATA_FLAG_EOF and NGHTTP2_DATA_FLAG_NO_END_STREAM set in</span>
<span class="c1">// *data_flag parameter in generator_cb passed to session::submit()</span>
<span class="c1">// function.</span>
<span class="kt">void</span> <span class="n">write_trailer</span><span class="p">(</span><span class="n">header_map</span> <span class="n">h</span><span class="p">)</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Cancels this request and response with given error code.</span>
<span class="kt">void</span> <span class="n">cancel</span><span class="p">(</span><span class="kt">uint32_t</span> <span class="n">error_code</span> <span class="o">=</span> <span class="n">NGHTTP2_INTERNAL_ERROR</span><span class="p">)</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Resumes deferred uploading.</span>
<span class="kt">void</span> <span class="n">resume</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Returns method (e.g., GET).</span>
<span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&amp;</span><span class="n">method</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Returns request URI, split into components.</span>
<span class="k">const</span> <span class="n">uri_ref</span> <span class="o">&amp;</span><span class="n">uri</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Returns request header fields. The pusedo header fields, which</span>
<span class="c1">// start with colon (:), are exluced from this list.</span>
<span class="k">const</span> <span class="n">header_map</span> <span class="o">&amp;</span><span class="n">header</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Application must not call this directly.</span>
<span class="n">request_impl</span> <span class="o">&amp;</span><span class="n">impl</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span>
<span class="k">private</span><span class="o">:</span>
<span class="n">std</span><span class="o">::</span><span class="n">unique_ptr</span><span class="o">&lt;</span><span class="n">request_impl</span><span class="o">&gt;</span> <span class="n">impl_</span><span class="p">;</span>
<span class="p">};</span>
<span class="k">class</span> <span class="nc">session_impl</span><span class="p">;</span>
<span class="k">class</span> <span class="nc">session</span> <span class="p">{</span>
<span class="k">public</span><span class="o">:</span>
<span class="c1">// Starts HTTP/2 session by connecting to |host| and |service|</span>
<span class="c1">// (e.g., &quot;80&quot;) using clear text TCP connection.</span>
<span class="n">session</span><span class="p">(</span><span class="n">boost</span><span class="o">::</span><span class="n">asio</span><span class="o">::</span><span class="n">io_service</span> <span class="o">&amp;</span><span class="n">io_service</span><span class="p">,</span> <span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&amp;</span><span class="n">host</span><span class="p">,</span>
<span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&amp;</span><span class="n">service</span><span class="p">);</span>
<span class="c1">// Starts HTTP/2 session by connecting to |host| and |service|</span>
<span class="c1">// (e.g., &quot;443&quot;) using encrypted SSL/TLS connection.</span>
<span class="n">session</span><span class="p">(</span><span class="n">boost</span><span class="o">::</span><span class="n">asio</span><span class="o">::</span><span class="n">io_service</span> <span class="o">&amp;</span><span class="n">io_service</span><span class="p">,</span>
<span class="n">boost</span><span class="o">::</span><span class="n">asio</span><span class="o">::</span><span class="n">ssl</span><span class="o">::</span><span class="n">context</span> <span class="o">&amp;</span><span class="n">tls_context</span><span class="p">,</span> <span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&amp;</span><span class="n">host</span><span class="p">,</span>
<span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&amp;</span><span class="n">service</span><span class="p">);</span>
<span class="o">~</span><span class="n">session</span><span class="p">();</span>
<span class="n">session</span><span class="p">(</span><span class="n">session</span> <span class="o">&amp;&amp;</span><span class="n">other</span><span class="p">)</span> <span class="k">noexcept</span><span class="p">;</span>
<span class="n">session</span> <span class="o">&amp;</span><span class="k">operator</span><span class="o">=</span><span class="p">(</span><span class="n">session</span> <span class="o">&amp;&amp;</span><span class="n">other</span><span class="p">)</span> <span class="k">noexcept</span><span class="p">;</span>
<span class="c1">// Sets callback which is invoked after connection is established.</span>
<span class="kt">void</span> <span class="n">on_connect</span><span class="p">(</span><span class="n">connect_cb</span> <span class="n">cb</span><span class="p">)</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Sets callback which is invoked there is connection level error</span>
<span class="c1">// and session is terminated.</span>
<span class="kt">void</span> <span class="n">on_error</span><span class="p">(</span><span class="n">error_cb</span> <span class="n">cb</span><span class="p">)</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Shutdowns connection.</span>
<span class="kt">void</span> <span class="n">shutdown</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Returns underlying io_service object.</span>
<span class="n">boost</span><span class="o">::</span><span class="n">asio</span><span class="o">::</span><span class="n">io_service</span> <span class="o">&amp;</span><span class="n">io_service</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Submits request to server using |method| (e.g., &quot;GET&quot;), |uri|</span>
<span class="c1">// (e.g., &quot;http://localhost/&quot;) and optionally additional header</span>
<span class="c1">// fields. This function returns pointer to request object if it</span>
<span class="c1">// succeeds, or nullptr and |ec| contains error message.</span>
<span class="k">const</span> <span class="n">request</span> <span class="o">*</span><span class="n">submit</span><span class="p">(</span><span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_code</span> <span class="o">&amp;</span><span class="n">ec</span><span class="p">,</span>
<span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&amp;</span><span class="n">method</span><span class="p">,</span> <span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&amp;</span><span class="n">uri</span><span class="p">,</span>
<span class="n">header_map</span> <span class="n">h</span> <span class="o">=</span> <span class="n">header_map</span><span class="p">{})</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Submits request to server using |method| (e.g., &quot;GET&quot;), |uri|</span>
<span class="c1">// (e.g., &quot;http://localhost/&quot;) and optionally additional header</span>
<span class="c1">// fields. The |data| is request body. This function returns</span>
<span class="c1">// pointer to request object if it succeeds, or nullptr and |ec|</span>
<span class="c1">// contains error message.</span>
<span class="k">const</span> <span class="n">request</span> <span class="o">*</span><span class="n">submit</span><span class="p">(</span><span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_code</span> <span class="o">&amp;</span><span class="n">ec</span><span class="p">,</span>
<span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&amp;</span><span class="n">method</span><span class="p">,</span> <span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&amp;</span><span class="n">uri</span><span class="p">,</span>
<span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">data</span><span class="p">,</span> <span class="n">header_map</span> <span class="n">h</span> <span class="o">=</span> <span class="n">header_map</span><span class="p">{})</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Submits request to server using |method| (e.g., &quot;GET&quot;), |uri|</span>
<span class="c1">// (e.g., &quot;http://localhost/&quot;) and optionally additional header</span>
<span class="c1">// fields. The |cb| is used to generate request body. This</span>
<span class="c1">// function returns pointer to request object if it succeeds, or</span>
<span class="c1">// nullptr and |ec| contains error message.</span>
<span class="k">const</span> <span class="n">request</span> <span class="o">*</span><span class="n">submit</span><span class="p">(</span><span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_code</span> <span class="o">&amp;</span><span class="n">ec</span><span class="p">,</span>
<span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&amp;</span><span class="n">method</span><span class="p">,</span> <span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&amp;</span><span class="n">uri</span><span class="p">,</span>
<span class="n">generator_cb</span> <span class="n">cb</span><span class="p">,</span> <span class="n">header_map</span> <span class="n">h</span> <span class="o">=</span> <span class="n">header_map</span><span class="p">{})</span> <span class="k">const</span><span class="p">;</span>
<span class="k">private</span><span class="o">:</span>
<span class="n">std</span><span class="o">::</span><span class="n">unique_ptr</span><span class="o">&lt;</span><span class="n">session_impl</span><span class="o">&gt;</span> <span class="n">impl_</span><span class="p">;</span>
<span class="p">};</span>
<span class="c1">// configure |tls_ctx| for client use. Currently, we just set NPN</span>
<span class="c1">// callback for HTTP/2.</span>
<span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_code</span>
<span class="n">configure_tls_context</span><span class="p">(</span><span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_code</span> <span class="o">&amp;</span><span class="n">ec</span><span class="p">,</span>
<span class="n">boost</span><span class="o">::</span><span class="n">asio</span><span class="o">::</span><span class="n">ssl</span><span class="o">::</span><span class="n">context</span> <span class="o">&amp;</span><span class="n">tls_ctx</span><span class="p">);</span>
<span class="p">}</span> <span class="c1">// namespace client</span>
<span class="p">}</span> <span class="c1">// namespace asio_http2</span>
<span class="p">}</span> <span class="c1">// namespace nghttp2</span>
<span class="cp">#endif </span><span class="c1">// ASIO_HTTP2_CLIENT_H</span>
</pre></div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="asio_http2.h.html" class="btn btn-neutral float-right" title="asio_http2.h">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="asio_http2_server.h.html" class="btn btn-neutral" title="asio_http2_server.h"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2012, 2015, Tatsuhiro Tsujikawa.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.7.8-DEV',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: false
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>

504
asio_http2_server.h.html Normal file
View File

@ -0,0 +1,504 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>asio_http2_server.h &mdash; nghttp2 0.7.8-DEV documentation</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="top" title="nghttp2 0.7.8-DEV documentation" href="index.html"/>
<link rel="next" title="asio_http2_client.h" href="asio_http2_client.h.html"/>
<link rel="prev" title="nghttp2ver.h" href="nghttp2ver.h.html"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="index.html" class="fa fa-home"> nghttp2</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="package_README.html">nghttp2 - HTTP/2 C Library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="package_README.html#development-status">Development Status</a></li>
<li class="toctree-l2"><a class="reference internal" href="package_README.html#public-test-server">Public Test Server</a></li>
<li class="toctree-l2"><a class="reference internal" href="package_README.html#requirements">Requirements</a></li>
<li class="toctree-l2"><a class="reference internal" href="package_README.html#build-from-git">Build from git</a></li>
<li class="toctree-l2"><a class="reference internal" href="package_README.html#building-documentation">Building documentation</a></li>
<li class="toctree-l2"><a class="reference internal" href="package_README.html#unit-tests">Unit tests</a></li>
<li class="toctree-l2"><a class="reference internal" href="package_README.html#integration-tests">Integration tests</a></li>
<li class="toctree-l2"><a class="reference internal" href="package_README.html#client-server-and-proxy-programs">Client, Server and Proxy programs</a></li>
<li class="toctree-l2"><a class="reference internal" href="package_README.html#benchmarking-tool">Benchmarking tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="package_README.html#hpack-tools">HPACK tools</a></li>
<li class="toctree-l2"><a class="reference internal" href="package_README.html#libnghttp2-asio-high-level-http-2-c-library">libnghttp2_asio: High level HTTP/2 C++ library</a></li>
<li class="toctree-l2"><a class="reference internal" href="package_README.html#python-bindings">Python bindings</a></li>
<li class="toctree-l2"><a class="reference internal" href="package_README.html#contribution">Contribution</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="contribute.html">Contribution Guidelines</a><ul>
<li class="toctree-l2"><a class="reference internal" href="contribute.html#coding-style">Coding style</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="building-android-binary.html">Building Android binary</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial-client.html">Tutorial: HTTP/2 client</a><ul>
<li class="toctree-l2"><a class="reference internal" href="tutorial-client.html#libevent-client-c">libevent-client.c</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="tutorial-server.html">Tutorial: HTTP/2 server</a><ul>
<li class="toctree-l2"><a class="reference internal" href="tutorial-server.html#libevent-server-c">libevent-server.c</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="tutorial-hpack.html">Tutorial: HPACK API</a><ul>
<li class="toctree-l2"><a class="reference internal" href="tutorial-hpack.html#deflating-encoding-headers">Deflating (encoding) headers</a></li>
<li class="toctree-l2"><a class="reference internal" href="tutorial-hpack.html#inflating-decoding-headers">Inflating (decoding) headers</a></li>
<li class="toctree-l2"><a class="reference internal" href="tutorial-hpack.html#deflate-c">deflate.c</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttp.1.html">nghttp(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpd.1.html">nghttpd(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpx.1.html">nghttpx(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#files">FILES</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#signals">SIGNALS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#server-push">SERVER PUSH</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#unix-domain-socket">UNIX DOMAIN SOCKET</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load.1.html">h2load(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#output">OUTPUT</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpx-howto.html">nghttpx - HTTP/2 proxy - HOW-TO</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#default-mode">Default mode</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#http-2-proxy-mode">HTTP/2 proxy mode</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#client-mode">Client mode</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#client-proxy-mode">Client proxy mode</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#http-2-bridge-mode">HTTP/2 bridge mode</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#disable-ssl-tls">Disable SSL/TLS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#specifying-additional-ca-certificate">Specifying additional CA certificate</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#read-write-rate-limit">Read/write rate limit</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#rewriting-location-header-field">Rewriting location header field</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#hot-swapping">Hot swapping</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#re-opening-log-files">Re-opening log files</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-backend-addresses">Multiple backend addresses</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load-howto.html">h2load - HTTP/2 benchmarking tool - HOW-TO</a><ul>
<li class="toctree-l2"><a class="reference internal" href="h2load-howto.html#basic-usage">Basic Usage</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load-howto.html#flow-control">Flow Control</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load-howto.html#multi-threading">Multi-Threading</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load-howto.html#selecting-protocol-for-clear-text">Selecting protocol for clear text</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load-howto.html#multiple-uris">Multiple URIs</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="apiref.html">API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#includes">Includes</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#remarks">Remarks</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#http-messaging">HTTP Messaging</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#macros">Macros</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#enums">Enums</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#types-structs-unions-and-typedefs">Types (structs, unions and typedefs)</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#functions">Functions</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="libnghttp2_asio.html">libnghttp2_asio: High level HTTP/2 C++ library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#server-api">Server API</a></li>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#client-api">Client API</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="python-apiref.html">Python API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="python-apiref.html#hpack-api">HPACK API</a></li>
<li class="toctree-l2"><a class="reference internal" href="python-apiref.html#http-2-servers">HTTP/2 servers</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2.h.html">nghttp2.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2ver.h.html">nghttp2ver.h</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="">asio_http2_server.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_client.h.html">asio_http2_client.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2.h.html">asio_http2.h</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2">Source</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2/issues">Issues</a></li>
<li class="toctree-l1"><a class="reference external" href="https://nghttp2.org/">nghttp2.org</a></li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">nghttp2</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> &raquo;</li>
<li>asio_http2_server.h</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document">
<div class="section" id="asio-http2-server-h">
<h1>asio_http2_server.h<a class="headerlink" href="#asio-http2-server-h" title="Permalink to this headline"></a></h1>
<div class="highlight-cpp"><div class="highlight"><pre><span class="cm">/*</span>
<span class="cm"> * nghttp2 - HTTP/2 C Library</span>
<span class="cm"> *</span>
<span class="cm"> * Copyright (c) 2015 Tatsuhiro Tsujikawa</span>
<span class="cm"> *</span>
<span class="cm"> * Permission is hereby granted, free of charge, to any person obtaining</span>
<span class="cm"> * a copy of this software and associated documentation files (the</span>
<span class="cm"> * &quot;Software&quot;), to deal in the Software without restriction, including</span>
<span class="cm"> * without limitation the rights to use, copy, modify, merge, publish,</span>
<span class="cm"> * distribute, sublicense, and/or sell copies of the Software, and to</span>
<span class="cm"> * permit persons to whom the Software is furnished to do so, subject to</span>
<span class="cm"> * the following conditions:</span>
<span class="cm"> *</span>
<span class="cm"> * The above copyright notice and this permission notice shall be</span>
<span class="cm"> * included in all copies or substantial portions of the Software.</span>
<span class="cm"> *</span>
<span class="cm"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,</span>
<span class="cm"> * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF</span>
<span class="cm"> * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND</span>
<span class="cm"> * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE</span>
<span class="cm"> * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION</span>
<span class="cm"> * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION</span>
<span class="cm"> * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</span>
<span class="cm"> */</span>
<span class="cp">#ifndef ASIO_HTTP2_SERVER_H</span>
<span class="cp">#define ASIO_HTTP2_SERVER_H</span>
<span class="cp">#include &lt;nghttp2/asio_http2.h&gt;</span>
<span class="k">namespace</span> <span class="n">nghttp2</span> <span class="p">{</span>
<span class="k">namespace</span> <span class="n">asio_http2</span> <span class="p">{</span>
<span class="k">namespace</span> <span class="n">server</span> <span class="p">{</span>
<span class="k">class</span> <span class="nc">request_impl</span><span class="p">;</span>
<span class="k">class</span> <span class="nc">response_impl</span><span class="p">;</span>
<span class="k">class</span> <span class="nc">request</span> <span class="p">{</span>
<span class="k">public</span><span class="o">:</span>
<span class="c1">// Application must not call this directly.</span>
<span class="n">request</span><span class="p">();</span>
<span class="o">~</span><span class="n">request</span><span class="p">();</span>
<span class="c1">// Returns request header fields. The pusedo header fields, which</span>
<span class="c1">// start with colon (:), are exluced from this list.</span>
<span class="k">const</span> <span class="n">header_map</span> <span class="o">&amp;</span><span class="n">header</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Returns method (e.g., GET).</span>
<span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&amp;</span><span class="n">method</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Returns request URI, split into components.</span>
<span class="k">const</span> <span class="n">uri_ref</span> <span class="o">&amp;</span><span class="n">uri</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Sets callback which is invoked when chunk of request body is</span>
<span class="c1">// received.</span>
<span class="kt">void</span> <span class="n">on_data</span><span class="p">(</span><span class="n">data_cb</span> <span class="n">cb</span><span class="p">)</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Application must not call this directly.</span>
<span class="n">request_impl</span> <span class="o">&amp;</span><span class="n">impl</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span>
<span class="k">private</span><span class="o">:</span>
<span class="n">std</span><span class="o">::</span><span class="n">unique_ptr</span><span class="o">&lt;</span><span class="n">request_impl</span><span class="o">&gt;</span> <span class="n">impl_</span><span class="p">;</span>
<span class="p">};</span>
<span class="k">class</span> <span class="nc">response</span> <span class="p">{</span>
<span class="k">public</span><span class="o">:</span>
<span class="c1">// Application must not call this directly.</span>
<span class="n">response</span><span class="p">();</span>
<span class="o">~</span><span class="n">response</span><span class="p">();</span>
<span class="c1">// Write response header using |status_code| (e.g., 200) and</span>
<span class="c1">// additional header fields in |h|.</span>
<span class="kt">void</span> <span class="n">write_head</span><span class="p">(</span><span class="kt">unsigned</span> <span class="kt">int</span> <span class="n">status_code</span><span class="p">,</span> <span class="n">header_map</span> <span class="n">h</span> <span class="o">=</span> <span class="n">header_map</span><span class="p">{})</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Sends |data| as request body. No further call of end() is</span>
<span class="c1">// allowed.</span>
<span class="kt">void</span> <span class="n">end</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">data</span> <span class="o">=</span> <span class="s">&quot;&quot;</span><span class="p">)</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Sets callback as a generator of the response body. No further</span>
<span class="c1">// call of end() is allowed.</span>
<span class="kt">void</span> <span class="n">end</span><span class="p">(</span><span class="n">generator_cb</span> <span class="n">cb</span><span class="p">)</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Write trailer part. This must be called after setting both</span>
<span class="c1">// NGHTTP2_DATA_FLAG_EOF and NGHTTP2_DATA_FLAG_NO_END_STREAM set in</span>
<span class="c1">// *data_flag parameter in generator_cb passed to end() function.</span>
<span class="kt">void</span> <span class="n">write_trailer</span><span class="p">(</span><span class="n">header_map</span> <span class="n">h</span><span class="p">)</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Sets callback which is invoked when this request and response are</span>
<span class="c1">// finished. After the invocation of this callback, the application</span>
<span class="c1">// must not access request and response object.</span>
<span class="kt">void</span> <span class="n">on_close</span><span class="p">(</span><span class="n">close_cb</span> <span class="n">cb</span><span class="p">)</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Cancels this request and response with given error code.</span>
<span class="kt">void</span> <span class="n">cancel</span><span class="p">(</span><span class="kt">uint32_t</span> <span class="n">error_code</span> <span class="o">=</span> <span class="n">NGHTTP2_INTERNAL_ERROR</span><span class="p">)</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Resumes deferred response.</span>
<span class="kt">void</span> <span class="n">resume</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Pushes resource denoted by |raw_path_query| using |method|. The</span>
<span class="c1">// additional header fields can be given in |h|. This function</span>
<span class="c1">// returns pointer to response object for promised stream, otherwise</span>
<span class="c1">// nullptr and error code is filled in |ec|. Be aware that the</span>
<span class="c1">// header field name given in |h| must be lower-cased.</span>
<span class="k">const</span> <span class="n">response</span> <span class="o">*</span><span class="n">push</span><span class="p">(</span><span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_code</span> <span class="o">&amp;</span><span class="n">ec</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">method</span><span class="p">,</span>
<span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">raw_path_query</span><span class="p">,</span>
<span class="n">header_map</span> <span class="n">h</span> <span class="o">=</span> <span class="n">header_map</span><span class="p">{})</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Returns status code.</span>
<span class="kt">unsigned</span> <span class="kt">int</span> <span class="n">status_code</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Returns boost::asio::io_service this response is running on.</span>
<span class="n">boost</span><span class="o">::</span><span class="n">asio</span><span class="o">::</span><span class="n">io_service</span> <span class="o">&amp;</span><span class="n">io_service</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span>
<span class="c1">// Application must not call this directly.</span>
<span class="n">response_impl</span> <span class="o">&amp;</span><span class="n">impl</span><span class="p">()</span> <span class="k">const</span><span class="p">;</span>
<span class="k">private</span><span class="o">:</span>
<span class="n">std</span><span class="o">::</span><span class="n">unique_ptr</span><span class="o">&lt;</span><span class="n">response_impl</span><span class="o">&gt;</span> <span class="n">impl_</span><span class="p">;</span>
<span class="p">};</span>
<span class="c1">// This is so called request callback. Called every time request is</span>
<span class="c1">// received. The life time of |request| and |response| objects end</span>
<span class="c1">// when callback set by response::on_close() is called. After that,</span>
<span class="c1">// the application must not access to those objects.</span>
<span class="k">typedef</span> <span class="n">std</span><span class="o">::</span><span class="n">function</span><span class="o">&lt;</span><span class="kt">void</span><span class="p">(</span><span class="k">const</span> <span class="n">request</span> <span class="o">&amp;</span><span class="p">,</span> <span class="k">const</span> <span class="n">response</span> <span class="o">&amp;</span><span class="p">)</span><span class="o">&gt;</span> <span class="n">request_cb</span><span class="p">;</span>
<span class="k">class</span> <span class="nc">http2_impl</span><span class="p">;</span>
<span class="k">class</span> <span class="nc">http2</span> <span class="p">{</span>
<span class="k">public</span><span class="o">:</span>
<span class="n">http2</span><span class="p">();</span>
<span class="o">~</span><span class="n">http2</span><span class="p">();</span>
<span class="n">http2</span><span class="p">(</span><span class="n">http2</span> <span class="o">&amp;&amp;</span><span class="n">other</span><span class="p">)</span> <span class="k">noexcept</span><span class="p">;</span>
<span class="n">http2</span> <span class="o">&amp;</span><span class="k">operator</span><span class="o">=</span><span class="p">(</span><span class="n">http2</span> <span class="o">&amp;&amp;</span><span class="n">other</span><span class="p">)</span> <span class="k">noexcept</span><span class="p">;</span>
<span class="c1">// Starts listening connection on given address and port and serves</span>
<span class="c1">// incoming requests in cleartext TCP connection.</span>
<span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_code</span> <span class="n">listen_and_serve</span><span class="p">(</span><span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_code</span> <span class="o">&amp;</span><span class="n">ec</span><span class="p">,</span>
<span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&amp;</span><span class="n">address</span><span class="p">,</span>
<span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&amp;</span><span class="n">port</span><span class="p">);</span>
<span class="c1">// Starts listening connection on given address and port and serves</span>
<span class="c1">// incoming requests in SSL/TLS encrypted connection.</span>
<span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_code</span>
<span class="n">listen_and_serve</span><span class="p">(</span><span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_code</span> <span class="o">&amp;</span><span class="n">ec</span><span class="p">,</span>
<span class="n">boost</span><span class="o">::</span><span class="n">asio</span><span class="o">::</span><span class="n">ssl</span><span class="o">::</span><span class="n">context</span> <span class="o">&amp;</span><span class="n">tls_context</span><span class="p">,</span>
<span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&amp;</span><span class="n">address</span><span class="p">,</span> <span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="o">&amp;</span><span class="n">port</span><span class="p">);</span>
<span class="c1">// Registers request handler |cb| with path pattern |pattern|. This</span>
<span class="c1">// function will fail and returns false if same pattern has been</span>
<span class="c1">// already registered or |pattern| is empty string. Otherwise</span>
<span class="c1">// returns true. The pattern match rule is the same as</span>
<span class="c1">// net/http/ServeMux in golang. Quoted from golang manual</span>
<span class="c1">// (http://golang.org/pkg/net/http/#ServeMux):</span>
<span class="c1">//</span>
<span class="c1">// Patterns name fixed, rooted paths, like &quot;/favicon.ico&quot;, or</span>
<span class="c1">// rooted subtrees, like &quot;/images/&quot; (note the trailing</span>
<span class="c1">// slash). Longer patterns take precedence over shorter ones, so</span>
<span class="c1">// that if there are handlers registered for both &quot;/images/&quot; and</span>
<span class="c1">// &quot;/images/thumbnails/&quot;, the latter handler will be called for</span>
<span class="c1">// paths beginning &quot;/images/thumbnails/&quot; and the former will</span>
<span class="c1">// receive requests for any other paths in the &quot;/images/&quot; subtree.</span>
<span class="c1">//</span>
<span class="c1">// Note that since a pattern ending in a slash names a rooted</span>
<span class="c1">// subtree, the pattern &quot;/&quot; matches all paths not matched by other</span>
<span class="c1">// registered patterns, not just the URL with Path == &quot;/&quot;.</span>
<span class="c1">//</span>
<span class="c1">// Patterns may optionally begin with a host name, restricting</span>
<span class="c1">// matches to URLs on that host only. Host-specific patterns take</span>
<span class="c1">// precedence over general patterns, so that a handler might</span>
<span class="c1">// register for the two patterns &quot;/codesearch&quot; and</span>
<span class="c1">// &quot;codesearch.google.com/&quot; without also taking over requests for</span>
<span class="c1">// &quot;http://www.google.com/&quot;.</span>
<span class="c1">//</span>
<span class="c1">// Just like ServeMux in golang, URL request path is sanitized and</span>
<span class="c1">// if they contains . or .. elements, they are redirected to an</span>
<span class="c1">// equivalent .- and ..-free URL.</span>
<span class="kt">bool</span> <span class="nf">handle</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">pattern</span><span class="p">,</span> <span class="n">request_cb</span> <span class="n">cb</span><span class="p">);</span>
<span class="c1">// Sets number of native threads to handle incoming HTTP request.</span>
<span class="c1">// It defaults to 1.</span>
<span class="kt">void</span> <span class="nf">num_threads</span><span class="p">(</span><span class="kt">size_t</span> <span class="n">num_threads</span><span class="p">);</span>
<span class="c1">// Sets the maximum length to which the queue of pending</span>
<span class="c1">// connections.</span>
<span class="kt">void</span> <span class="nf">backlog</span><span class="p">(</span><span class="kt">int</span> <span class="n">backlog</span><span class="p">);</span>
<span class="k">private</span><span class="o">:</span>
<span class="n">std</span><span class="o">::</span><span class="n">unique_ptr</span><span class="o">&lt;</span><span class="n">http2_impl</span><span class="o">&gt;</span> <span class="n">impl_</span><span class="p">;</span>
<span class="p">};</span>
<span class="c1">// Configures |tls_context| for server use. This function sets couple</span>
<span class="c1">// of OpenSSL options (disables SSLv2 and SSLv3 and compression) and</span>
<span class="c1">// enables ECDHE ciphers. NPN callback is also configured.</span>
<span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_code</span>
<span class="n">configure_tls_context_easy</span><span class="p">(</span><span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_code</span> <span class="o">&amp;</span><span class="n">ec</span><span class="p">,</span>
<span class="n">boost</span><span class="o">::</span><span class="n">asio</span><span class="o">::</span><span class="n">ssl</span><span class="o">::</span><span class="n">context</span> <span class="o">&amp;</span><span class="n">tls_context</span><span class="p">);</span>
<span class="c1">// Returns request handler to do redirect to |uri| using</span>
<span class="c1">// |status_code|. The |uri| appears in &quot;location&quot; header field as is.</span>
<span class="n">request_cb</span> <span class="nf">redirect_handler</span><span class="p">(</span><span class="kt">int</span> <span class="n">status_code</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">uri</span><span class="p">);</span>
<span class="c1">// Returns request handler to reply with given |status_code| and HTML</span>
<span class="c1">// including message about status code.</span>
<span class="n">request_cb</span> <span class="nf">status_handler</span><span class="p">(</span><span class="kt">int</span> <span class="n">status_code</span><span class="p">);</span>
<span class="p">}</span> <span class="c1">// namespace server</span>
<span class="p">}</span> <span class="c1">// namespace asio_http2</span>
<span class="p">}</span> <span class="c1">// namespace nghttp2</span>
<span class="cp">#endif </span><span class="c1">// ASIO_HTTP2_SERVER_H</span>
</pre></div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="asio_http2_client.h.html" class="btn btn-neutral float-right" title="asio_http2_client.h">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="nghttp2ver.h.html" class="btn btn-neutral" title="nghttp2ver.h"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2012, 2015, Tatsuhiro Tsujikawa.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.7.8-DEV',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: false
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>

View File

@ -7,7 +7,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Building Android binary &mdash; nghttp2 0.7.2-DEV documentation</title>
<title>Building Android binary &mdash; nghttp2 0.7.8-DEV documentation</title>
@ -28,7 +28,7 @@
<link rel="top" title="nghttp2 0.7.2-DEV documentation" href="index.html"/>
<link rel="top" title="nghttp2 0.7.8-DEV documentation" href="index.html"/>
<link rel="next" title="Tutorial: HTTP/2 client" href="tutorial-client.html"/>
<link rel="prev" title="Contribution Guidelines" href="contribute.html"/>
@ -100,30 +100,33 @@
<li class="toctree-l1"><a class="reference internal" href="nghttp.1.html">nghttp(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpd.1.html">nghttpd(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpx.1.html">nghttpx(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#files">FILES</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#signals">SIGNALS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#server-push">SERVER PUSH</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#unix-domain-socket">UNIX DOMAIN SOCKET</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load.1.html">h2load(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#output">OUTPUT</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
@ -139,7 +142,7 @@
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#rewriting-location-header-field">Rewriting location header field</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#hot-swapping">Hot swapping</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#re-opening-log-files">Re-opening log files</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-http-1-backend-addresses">Multiple HTTP/1 backend addresses</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-backend-addresses">Multiple backend addresses</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load-howto.html">h2load - HTTP/2 benchmarking tool - HOW-TO</a><ul>
@ -153,6 +156,7 @@
<li class="toctree-l1"><a class="reference internal" href="apiref.html">API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#includes">Includes</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#remarks">Remarks</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#http-messaging">HTTP Messaging</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#macros">Macros</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#enums">Enums</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#types-structs-unions-and-typedefs">Types (structs, unions and typedefs)</a></li>
@ -161,6 +165,7 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="libnghttp2_asio.html">libnghttp2_asio: High level HTTP/2 C++ library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#server-api">Server API</a></li>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#client-api">Client API</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="python-apiref.html">Python API Reference</a><ul>
@ -170,6 +175,8 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2.h.html">nghttp2.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2ver.h.html">nghttp2ver.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_server.h.html">asio_http2_server.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_client.h.html">asio_http2_client.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2.h.html">asio_http2.h</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2">Source</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2/issues">Issues</a></li>
@ -366,7 +373,7 @@ using the following command:</p>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.7.2-DEV',
VERSION:'0.7.8-DEV',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: false

View File

@ -7,7 +7,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Contribution Guidelines &mdash; nghttp2 0.7.2-DEV documentation</title>
<title>Contribution Guidelines &mdash; nghttp2 0.7.8-DEV documentation</title>
@ -28,7 +28,7 @@
<link rel="top" title="nghttp2 0.7.2-DEV documentation" href="index.html"/>
<link rel="top" title="nghttp2 0.7.8-DEV documentation" href="index.html"/>
<link rel="next" title="Building Android binary" href="building-android-binary.html"/>
<link rel="prev" title="nghttp2 - HTTP/2 C Library" href="package_README.html"/>
@ -100,30 +100,33 @@
<li class="toctree-l1"><a class="reference internal" href="nghttp.1.html">nghttp(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpd.1.html">nghttpd(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpx.1.html">nghttpx(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#files">FILES</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#signals">SIGNALS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#server-push">SERVER PUSH</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#unix-domain-socket">UNIX DOMAIN SOCKET</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load.1.html">h2load(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#output">OUTPUT</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
@ -139,7 +142,7 @@
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#rewriting-location-header-field">Rewriting location header field</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#hot-swapping">Hot swapping</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#re-opening-log-files">Re-opening log files</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-http-1-backend-addresses">Multiple HTTP/1 backend addresses</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-backend-addresses">Multiple backend addresses</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load-howto.html">h2load - HTTP/2 benchmarking tool - HOW-TO</a><ul>
@ -153,6 +156,7 @@
<li class="toctree-l1"><a class="reference internal" href="apiref.html">API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#includes">Includes</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#remarks">Remarks</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#http-messaging">HTTP Messaging</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#macros">Macros</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#enums">Enums</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#types-structs-unions-and-typedefs">Types (structs, unions and typedefs)</a></li>
@ -161,6 +165,7 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="libnghttp2_asio.html">libnghttp2_asio: High level HTTP/2 C++ library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#server-api">Server API</a></li>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#client-api">Client API</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="python-apiref.html">Python API Reference</a><ul>
@ -170,6 +175,8 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2.h.html">nghttp2.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2ver.h.html">nghttp2ver.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_server.h.html">asio_http2_server.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_client.h.html">asio_http2_client.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2.h.html">asio_http2.h</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2">Source</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2/issues">Issues</a></li>
@ -295,7 +302,7 @@ And add these lines to your .emacs file:</p>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.7.2-DEV',
VERSION:'0.7.8-DEV',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: false

View File

@ -8,7 +8,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Index &mdash; nghttp2 0.7.2-DEV documentation</title>
<title>Index &mdash; nghttp2 0.7.8-DEV documentation</title>
@ -29,7 +29,7 @@
<link rel="top" title="nghttp2 0.7.2-DEV documentation" href="index.html"/>
<link rel="top" title="nghttp2 0.7.8-DEV documentation" href="index.html"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
@ -99,30 +99,33 @@
<li class="toctree-l1"><a class="reference internal" href="nghttp.1.html">nghttp(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpd.1.html">nghttpd(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpx.1.html">nghttpx(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#files">FILES</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#signals">SIGNALS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#server-push">SERVER PUSH</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#unix-domain-socket">UNIX DOMAIN SOCKET</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load.1.html">h2load(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#output">OUTPUT</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
@ -138,7 +141,7 @@
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#rewriting-location-header-field">Rewriting location header field</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#hot-swapping">Hot swapping</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#re-opening-log-files">Re-opening log files</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-http-1-backend-addresses">Multiple HTTP/1 backend addresses</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-backend-addresses">Multiple backend addresses</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load-howto.html">h2load - HTTP/2 benchmarking tool - HOW-TO</a><ul>
@ -152,6 +155,7 @@
<li class="toctree-l1"><a class="reference internal" href="apiref.html">API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#includes">Includes</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#remarks">Remarks</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#http-messaging">HTTP Messaging</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#macros">Macros</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#enums">Enums</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#types-structs-unions-and-typedefs">Types (structs, unions and typedefs)</a></li>
@ -160,6 +164,7 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="libnghttp2_asio.html">libnghttp2_asio: High level HTTP/2 C++ library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#server-api">Server API</a></li>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#client-api">Client API</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="python-apiref.html">Python API Reference</a><ul>
@ -169,6 +174,8 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2.h.html">nghttp2.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2ver.h.html">nghttp2ver.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_server.h.html">asio_http2_server.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_client.h.html">asio_http2_client.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2.h.html">asio_http2.h</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2">Source</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2/issues">Issues</a></li>
@ -338,6 +345,17 @@
</dl></dd>
<dt>
--backend-http2-connections-per-worker=&lt;N&gt;
</dt>
<dd><dl>
<dt><a href="nghttpx.1.html#cmdoption--backend-http2-connections-per-worker">command line option</a>
</dt>
</dl></dd>
<dt>
--backend-http2-window-bits=&lt;N&gt;
</dt>
@ -372,7 +390,7 @@
</dl></dd>
<dt>
--backend-keep-alive-timeout=&lt;SEC&gt;
--backend-keep-alive-timeout=&lt;DURATION&gt;
</dt>
<dd><dl>
@ -394,7 +412,7 @@
</dl></dd>
<dt>
--backend-read-timeout=&lt;SEC&gt;
--backend-read-timeout=&lt;DURATION&gt;
</dt>
<dd><dl>
@ -438,7 +456,7 @@
</dl></dd>
<dt>
--backend-write-timeout=&lt;SEC&gt;
--backend-write-timeout=&lt;DURATION&gt;
</dt>
<dd><dl>
@ -647,7 +665,7 @@
</dl></dd>
<dt>
--frontend-http2-read-timeout=&lt;SEC&gt;
--frontend-http2-read-timeout=&lt;DURATION&gt;
</dt>
<dd><dl>
@ -680,7 +698,7 @@
</dl></dd>
<dt>
--frontend-read-timeout=&lt;SEC&gt;
--frontend-read-timeout=&lt;DURATION&gt;
</dt>
<dd><dl>
@ -691,7 +709,7 @@
</dl></dd>
<dt>
--frontend-write-timeout=&lt;SEC&gt;
--frontend-write-timeout=&lt;DURATION&gt;
</dt>
<dd><dl>
@ -735,7 +753,7 @@
</dl></dd>
<dt>
--listener-disable-timeout=&lt;SEC&gt;
--listener-disable-timeout=&lt;DURATION&gt;
</dt>
<dd><dl>
@ -767,6 +785,17 @@
</dl></dd>
<dt>
--no-host-rewrite
</dt>
<dd><dl>
<dt><a href="nghttpx.1.html#cmdoption--no-host-rewrite">command line option</a>
</dt>
</dl></dd>
<dt>
--no-location-rewrite
</dt>
@ -778,6 +807,17 @@
</dl></dd>
<dt>
--no-server-push
</dt>
<dd><dl>
<dt><a href="nghttpx.1.html#cmdoption--no-server-push">command line option</a>
</dt>
</dl></dd>
<dt>
--no-tls
</dt>
@ -865,6 +905,8 @@
</dt>
</dl></dd>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt>
--rlimit-nofile=&lt;N&gt;
@ -876,11 +918,9 @@
</dt>
</dl></dd>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt>
--stream-read-timeout=&lt;SEC&gt;
--stream-read-timeout=&lt;DURATION&gt;
</dt>
<dd><dl>
@ -891,7 +931,7 @@
</dl></dd>
<dt>
--stream-write-timeout=&lt;SEC&gt;
--stream-write-timeout=&lt;DURATION&gt;
</dt>
<dd><dl>
@ -967,6 +1007,17 @@
</dl></dd>
<dt>
--trailer=&lt;HEADER&gt;
</dt>
<dd><dl>
<dt><a href="nghttp.1.html#cmdoption--trailer">command line option</a>, <a href="nghttpd.1.html#cmdoption--trailer">[1]</a>
</dt>
</dl></dd>
<dt>
--user=&lt;USER&gt;
</dt>
@ -1088,6 +1139,17 @@
</dl></dd>
<dt>
-a, --address=&lt;ADDR&gt;
</dt>
<dd><dl>
<dt><a href="nghttpd.1.html#cmdoption-a">command line option</a>
</dt>
</dl></dd>
<dt>
-a, --get-assets
</dt>
@ -1226,7 +1288,7 @@
<dd><dl>
<dt><a href="nghttp.1.html#cmdoption-h">command line option</a>, <a href="nghttpx.1.html#cmdoption-h">[1]</a>, <a href="nghttpd.1.html#cmdoption-h">[2]</a>, <a href="h2load.1.html#cmdoption-h">[3]</a>
<dt><a href="nghttpx.1.html#cmdoption-h">command line option</a>, <a href="nghttp.1.html#cmdoption-h">[1]</a>, <a href="nghttpd.1.html#cmdoption-h">[2]</a>, <a href="h2load.1.html#cmdoption-h">[3]</a>
</dt>
</dl></dd>
@ -1595,6 +1657,10 @@
</dt>
<dt><a href="nghttpx.1.html#cmdoption--backend-http2-connections-per-worker">--backend-http2-connections-per-worker=&lt;N&gt;</a>
</dt>
<dt><a href="nghttpx.1.html#cmdoption--backend-http2-window-bits">--backend-http2-window-bits=&lt;N&gt;</a>
</dt>
@ -1607,7 +1673,7 @@
</dt>
<dt><a href="nghttpx.1.html#cmdoption--backend-keep-alive-timeout">--backend-keep-alive-timeout=&lt;SEC&gt;</a>
<dt><a href="nghttpx.1.html#cmdoption--backend-keep-alive-timeout">--backend-keep-alive-timeout=&lt;DURATION&gt;</a>
</dt>
@ -1615,7 +1681,7 @@
</dt>
<dt><a href="nghttpx.1.html#cmdoption--backend-read-timeout">--backend-read-timeout=&lt;SEC&gt;</a>
<dt><a href="nghttpx.1.html#cmdoption--backend-read-timeout">--backend-read-timeout=&lt;DURATION&gt;</a>
</dt>
@ -1631,7 +1697,7 @@
</dt>
<dt><a href="nghttpx.1.html#cmdoption--backend-write-timeout">--backend-write-timeout=&lt;SEC&gt;</a>
<dt><a href="nghttpx.1.html#cmdoption--backend-write-timeout">--backend-write-timeout=&lt;DURATION&gt;</a>
</dt>
@ -1707,7 +1773,7 @@
</dt>
<dt><a href="nghttpx.1.html#cmdoption--frontend-http2-read-timeout">--frontend-http2-read-timeout=&lt;SEC&gt;</a>
<dt><a href="nghttpx.1.html#cmdoption--frontend-http2-read-timeout">--frontend-http2-read-timeout=&lt;DURATION&gt;</a>
</dt>
@ -1719,11 +1785,11 @@
</dt>
<dt><a href="nghttpx.1.html#cmdoption--frontend-read-timeout">--frontend-read-timeout=&lt;SEC&gt;</a>
<dt><a href="nghttpx.1.html#cmdoption--frontend-read-timeout">--frontend-read-timeout=&lt;DURATION&gt;</a>
</dt>
<dt><a href="nghttpx.1.html#cmdoption--frontend-write-timeout">--frontend-write-timeout=&lt;SEC&gt;</a>
<dt><a href="nghttpx.1.html#cmdoption--frontend-write-timeout">--frontend-write-timeout=&lt;DURATION&gt;</a>
</dt>
@ -1739,7 +1805,7 @@
</dt>
<dt><a href="nghttpx.1.html#cmdoption--listener-disable-timeout">--listener-disable-timeout=&lt;SEC&gt;</a>
<dt><a href="nghttpx.1.html#cmdoption--listener-disable-timeout">--listener-disable-timeout=&lt;DURATION&gt;</a>
</dt>
@ -1751,10 +1817,18 @@
</dt>
<dt><a href="nghttpx.1.html#cmdoption--no-host-rewrite">--no-host-rewrite</a>
</dt>
<dt><a href="nghttpx.1.html#cmdoption--no-location-rewrite">--no-location-rewrite</a>
</dt>
<dt><a href="nghttpx.1.html#cmdoption--no-server-push">--no-server-push</a>
</dt>
<dt><a href="nghttpd.1.html#cmdoption--no-tls">--no-tls</a>
</dt>
@ -1791,11 +1865,11 @@
</dt>
<dt><a href="nghttpx.1.html#cmdoption--stream-read-timeout">--stream-read-timeout=&lt;SEC&gt;</a>
<dt><a href="nghttpx.1.html#cmdoption--stream-read-timeout">--stream-read-timeout=&lt;DURATION&gt;</a>
</dt>
<dt><a href="nghttpx.1.html#cmdoption--stream-write-timeout">--stream-write-timeout=&lt;SEC&gt;</a>
<dt><a href="nghttpx.1.html#cmdoption--stream-write-timeout">--stream-write-timeout=&lt;DURATION&gt;</a>
</dt>
@ -1823,6 +1897,10 @@
</dt>
<dt><a href="nghttp.1.html#cmdoption--trailer">--trailer=&lt;HEADER&gt;</a>, <a href="nghttpd.1.html#cmdoption--trailer">[1]</a>
</dt>
<dt><a href="nghttpx.1.html#cmdoption--user">--user=&lt;USER&gt;</a>
</dt>
@ -1895,6 +1973,10 @@
</dt>
<dt><a href="nghttpd.1.html#cmdoption-a">-a, --address=&lt;ADDR&gt;</a>
</dt>
<dt><a href="nghttp.1.html#cmdoption-a">-a, --get-assets</a>
</dt>
@ -1935,7 +2017,7 @@
</dt>
<dt><a href="nghttp.1.html#cmdoption-h">-h, --help</a>, <a href="nghttpx.1.html#cmdoption-h">[1]</a>, <a href="nghttpd.1.html#cmdoption-h">[2]</a>, <a href="h2load.1.html#cmdoption-h">[3]</a>
<dt><a href="nghttpx.1.html#cmdoption-h">-h, --help</a>, <a href="nghttp.1.html#cmdoption-h">[1]</a>, <a href="nghttpd.1.html#cmdoption-h">[2]</a>, <a href="h2load.1.html#cmdoption-h">[3]</a>
</dt>
@ -2190,6 +2272,10 @@
</dt>
<dt><a href="apiref.html#c.NGHTTP2_DATA_FLAG_NO_END_STREAM">NGHTTP2_DATA_FLAG_NO_END_STREAM (C macro)</a>
</dt>
<dt><a href="apiref.html#c.NGHTTP2_DATA_FLAG_NONE">NGHTTP2_DATA_FLAG_NONE (C macro)</a>
</dt>
@ -2286,6 +2372,10 @@
</dt>
<dt><a href="apiref.html#c.NGHTTP2_ERR_HTTP_HEADER">NGHTTP2_ERR_HTTP_HEADER (C macro)</a>
</dt>
<dt><a href="apiref.html#c.NGHTTP2_ERR_INSUFF_BUFSIZE">NGHTTP2_ERR_INSUFF_BUFSIZE (C macro)</a>
</dt>
@ -2757,12 +2847,12 @@
<dt><a href="apiref.html#c.nghttp2_malloc">nghttp2_malloc (C type)</a>
</dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="apiref.html#c.NGHTTP2_MAX_WEIGHT">NGHTTP2_MAX_WEIGHT (C macro)</a>
</dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="apiref.html#c.NGHTTP2_MAX_WINDOW_SIZE">NGHTTP2_MAX_WINDOW_SIZE (C macro)</a>
</dt>
@ -2892,6 +2982,10 @@
</dt>
<dt><a href="apiref.html#c.nghttp2_option_set_no_http_messaging">nghttp2_option_set_no_http_messaging (C function)</a>
</dt>
<dt><a href="apiref.html#c.nghttp2_option_set_peer_max_concurrent_streams">nghttp2_option_set_peer_max_concurrent_streams (C function)</a>
</dt>
@ -2960,6 +3054,14 @@
</dt>
<dt><a href="apiref.html#c.NGHTTP2_PROTO_ALPN">NGHTTP2_PROTO_ALPN (C macro)</a>
</dt>
<dt><a href="apiref.html#c.NGHTTP2_PROTO_ALPN_LEN">NGHTTP2_PROTO_ALPN_LEN (C macro)</a>
</dt>
<dt><a href="apiref.html#c.NGHTTP2_PROTO_VERSION_ID">NGHTTP2_PROTO_VERSION_ID (C macro)</a>
</dt>
@ -3368,6 +3470,10 @@
</dt>
<dt><a href="apiref.html#c.nghttp2_submit_trailer">nghttp2_submit_trailer (C function)</a>
</dt>
<dt><a href="apiref.html#c.nghttp2_submit_window_update">nghttp2_submit_window_update (C function)</a>
</dt>
@ -3513,7 +3619,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.7.2-DEV',
VERSION:'0.7.8-DEV',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: false

View File

@ -7,7 +7,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>h2load - HTTP/2 benchmarking tool - HOW-TO &mdash; nghttp2 0.7.2-DEV documentation</title>
<title>h2load - HTTP/2 benchmarking tool - HOW-TO &mdash; nghttp2 0.7.8-DEV documentation</title>
@ -28,7 +28,7 @@
<link rel="top" title="nghttp2 0.7.2-DEV documentation" href="index.html"/>
<link rel="top" title="nghttp2 0.7.8-DEV documentation" href="index.html"/>
<link rel="next" title="API Reference" href="apiref.html"/>
<link rel="prev" title="nghttpx - HTTP/2 proxy - HOW-TO" href="nghttpx-howto.html"/>
@ -100,30 +100,33 @@
<li class="toctree-l1"><a class="reference internal" href="nghttp.1.html">nghttp(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpd.1.html">nghttpd(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpx.1.html">nghttpx(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#files">FILES</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#signals">SIGNALS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#server-push">SERVER PUSH</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#unix-domain-socket">UNIX DOMAIN SOCKET</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load.1.html">h2load(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#output">OUTPUT</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
@ -139,7 +142,7 @@
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#rewriting-location-header-field">Rewriting location header field</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#hot-swapping">Hot swapping</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#re-opening-log-files">Re-opening log files</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-http-1-backend-addresses">Multiple HTTP/1 backend addresses</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-backend-addresses">Multiple backend addresses</a></li>
</ul>
</li>
<li class="toctree-l1 current"><a class="current reference internal" href="">h2load - HTTP/2 benchmarking tool - HOW-TO</a><ul>
@ -153,6 +156,7 @@
<li class="toctree-l1"><a class="reference internal" href="apiref.html">API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#includes">Includes</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#remarks">Remarks</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#http-messaging">HTTP Messaging</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#macros">Macros</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#enums">Enums</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#types-structs-unions-and-typedefs">Types (structs, unions and typedefs)</a></li>
@ -161,6 +165,7 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="libnghttp2_asio.html">libnghttp2_asio: High level HTTP/2 C++ library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#server-api">Server API</a></li>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#client-api">Client API</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="python-apiref.html">Python API Reference</a><ul>
@ -170,6 +175,8 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2.h.html">nghttp2.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2ver.h.html">nghttp2ver.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_server.h.html">asio_http2_server.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_client.h.html">asio_http2_client.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2.h.html">asio_http2.h</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2">Source</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2/issues">Issues</a></li>
@ -330,7 +337,7 @@ and ignores those parts in the rest of the URIs.</p>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.7.2-DEV',
VERSION:'0.7.8-DEV',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: false

View File

@ -7,7 +7,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>h2load(1) &mdash; nghttp2 0.7.2-DEV documentation</title>
<title>h2load(1) &mdash; nghttp2 0.7.8-DEV documentation</title>
@ -28,7 +28,7 @@
<link rel="top" title="nghttp2 0.7.2-DEV documentation" href="index.html"/>
<link rel="top" title="nghttp2 0.7.8-DEV documentation" href="index.html"/>
<link rel="next" title="nghttpx - HTTP/2 proxy - HOW-TO" href="nghttpx-howto.html"/>
<link rel="prev" title="nghttpx(1)" href="nghttpx.1.html"/>
@ -100,30 +100,33 @@
<li class="toctree-l1"><a class="reference internal" href="nghttp.1.html">nghttp(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpd.1.html">nghttpd(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpx.1.html">nghttpx(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#files">FILES</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#signals">SIGNALS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#server-push">SERVER PUSH</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#unix-domain-socket">UNIX DOMAIN SOCKET</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1 current"><a class="current reference internal" href="">h2load(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="#output">OUTPUT</a></li>
<li class="toctree-l2"><a class="reference internal" href="#see-also">SEE ALSO</a></li>
</ul>
</li>
@ -139,7 +142,7 @@
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#rewriting-location-header-field">Rewriting location header field</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#hot-swapping">Hot swapping</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#re-opening-log-files">Re-opening log files</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-http-1-backend-addresses">Multiple HTTP/1 backend addresses</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-backend-addresses">Multiple backend addresses</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load-howto.html">h2load - HTTP/2 benchmarking tool - HOW-TO</a><ul>
@ -153,6 +156,7 @@
<li class="toctree-l1"><a class="reference internal" href="apiref.html">API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#includes">Includes</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#remarks">Remarks</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#http-messaging">HTTP Messaging</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#macros">Macros</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#enums">Enums</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#types-structs-unions-and-typedefs">Types (structs, unions and typedefs)</a></li>
@ -161,6 +165,7 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="libnghttp2_asio.html">libnghttp2_asio: High level HTTP/2 C++ library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#server-api">Server API</a></li>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#client-api">Client API</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="python-apiref.html">Python API Reference</a><ul>
@ -170,6 +175,8 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2.h.html">nghttp2.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2ver.h.html">nghttp2ver.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_server.h.html">asio_http2_server.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_client.h.html">asio_http2_client.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2.h.html">asio_http2.h</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2">Source</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2/issues">Issues</a></li>
@ -229,7 +236,7 @@ are used solely.</p>
</div>
<div class="section" id="options">
<h2>OPTIONS:<a class="headerlink" href="#options" title="Permalink to this headline"></a></h2>
<h2>OPTIONS<a class="headerlink" href="#options" title="Permalink to this headline"></a></h2>
<dl class="option">
<dt id="cmdoption-n">
<span id="cmdoption--requests"></span><tt class="descname">-n</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">--requests</tt><tt class="descclassname">=&lt;N&gt;</tt><a class="headerlink" href="#cmdoption-n" title="Permalink to this definition"></a></dt>
@ -321,6 +328,64 @@ Available protocols: spdy/2, spdy/3, spdy/3.1 and h2c-14</p>
<dd><p>Display this help and exit.</p>
</dd></dl>
</div>
<div class="section" id="output">
<h2>OUTPUT<a class="headerlink" href="#output" title="Permalink to this headline"></a></h2>
<dl class="docutils">
<dt>requests</dt>
<dd><dl class="first last docutils">
<dt>total</dt>
<dd>The number of requests h2load was instructed to make.</dd>
<dt>started</dt>
<dd>The number of requests h2load has started.</dd>
<dt>done</dt>
<dd>The number of requests completed.</dd>
<dt>succeeded</dt>
<dd>The number of requests completed successfully. Only HTTP status
code 2xx or3xx are considered as success.</dd>
<dt>failed</dt>
<dd>The number of requests failed, including HTTP level failures
(non-successful HTTP status code).</dd>
<dt>errored</dt>
<dd>The number of requests failed, except for HTTP level failures.
status code. This is the subset of the number reported in
<tt class="docutils literal"><span class="pre">failed</span></tt> and most likely the network level failures or stream
was reset by RST_STREAM.</dd>
</dl>
</dd>
<dt>status codes</dt>
<dd>The number of status code h2load received.</dd>
<dt>traffic</dt>
<dd><dl class="first last docutils">
<dt>total</dt>
<dd>The number of bytes received from the server &quot;on the wire&quot;. If
requests were made via TLS, this value is the number of decrpyted
bytes.</dd>
<dt>headers</dt>
<dd>The number of response header bytes from the server without
decompression. For HTTP/2, this is the sum of the payload of
HEADERS frame. For SPDY, this is the sum of the payload of
SYN_REPLY frame.</dd>
<dt>data</dt>
<dd>The number of response body bytes received from the server.</dd>
</dl>
</dd>
<dt>time for request</dt>
<dd><dl class="first last docutils">
<dt>min</dt>
<dd>The minimum time taken for request and response.</dd>
<dt>max</dt>
<dd>The maximum time taken for request and response.</dd>
<dt>mean</dt>
<dd>The mean time taken for request and response.</dd>
<dt>sd</dt>
<dd>The standard deviation of the time for request and response.</dd>
<dt>+/- sd</dt>
<dd>The fraction of the number of requests within standard deviation
range (mean +/- sd) against total number of successful requests.</dd>
</dl>
</dd>
</dl>
</div>
<div class="section" id="see-also">
<h2>SEE ALSO<a class="headerlink" href="#see-also" title="Permalink to this headline"></a></h2>
@ -367,7 +432,7 @@ Available protocols: spdy/2, spdy/3, spdy/3.1 and h2c-14</p>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.7.2-DEV',
VERSION:'0.7.8-DEV',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: false

View File

@ -7,7 +7,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>nghttp2 - HTTP/2 C Library &mdash; nghttp2 0.7.2-DEV documentation</title>
<title>nghttp2 - HTTP/2 C Library &mdash; nghttp2 0.7.8-DEV documentation</title>
@ -28,7 +28,7 @@
<link rel="top" title="nghttp2 0.7.2-DEV documentation" href="#"/>
<link rel="top" title="nghttp2 0.7.8-DEV documentation" href="#"/>
<link rel="next" title="nghttp2 - HTTP/2 C Library" href="package_README.html"/>
@ -99,30 +99,33 @@
<li class="toctree-l1"><a class="reference internal" href="nghttp.1.html">nghttp(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpd.1.html">nghttpd(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpx.1.html">nghttpx(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#files">FILES</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#signals">SIGNALS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#server-push">SERVER PUSH</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#unix-domain-socket">UNIX DOMAIN SOCKET</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load.1.html">h2load(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#output">OUTPUT</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
@ -138,7 +141,7 @@
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#rewriting-location-header-field">Rewriting location header field</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#hot-swapping">Hot swapping</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#re-opening-log-files">Re-opening log files</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-http-1-backend-addresses">Multiple HTTP/1 backend addresses</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-backend-addresses">Multiple backend addresses</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load-howto.html">h2load - HTTP/2 benchmarking tool - HOW-TO</a><ul>
@ -152,6 +155,7 @@
<li class="toctree-l1"><a class="reference internal" href="apiref.html">API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#includes">Includes</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#remarks">Remarks</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#http-messaging">HTTP Messaging</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#macros">Macros</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#enums">Enums</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#types-structs-unions-and-typedefs">Types (structs, unions and typedefs)</a></li>
@ -160,6 +164,7 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="libnghttp2_asio.html">libnghttp2_asio: High level HTTP/2 C++ library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#server-api">Server API</a></li>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#client-api">Client API</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="python-apiref.html">Python API Reference</a><ul>
@ -169,6 +174,8 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2.h.html">nghttp2.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2ver.h.html">nghttp2ver.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_server.h.html">asio_http2_server.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_client.h.html">asio_http2_client.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2.h.html">asio_http2.h</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2">Source</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2/issues">Issues</a></li>
@ -252,30 +259,33 @@ version 2.</p>
<li class="toctree-l1"><a class="reference internal" href="nghttp.1.html">nghttp(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpd.1.html">nghttpd(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpx.1.html">nghttpx(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#files">FILES</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#signals">SIGNALS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#server-push">SERVER PUSH</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#unix-domain-socket">UNIX DOMAIN SOCKET</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load.1.html">h2load(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#output">OUTPUT</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
@ -291,7 +301,7 @@ version 2.</p>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#rewriting-location-header-field">Rewriting location header field</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#hot-swapping">Hot swapping</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#re-opening-log-files">Re-opening log files</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-http-1-backend-addresses">Multiple HTTP/1 backend addresses</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-backend-addresses">Multiple backend addresses</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load-howto.html">h2load - HTTP/2 benchmarking tool - HOW-TO</a><ul>
@ -305,6 +315,7 @@ version 2.</p>
<li class="toctree-l1"><a class="reference internal" href="apiref.html">API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#includes">Includes</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#remarks">Remarks</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#http-messaging">HTTP Messaging</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#macros">Macros</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#enums">Enums</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#types-structs-unions-and-typedefs">Types (structs, unions and typedefs)</a></li>
@ -313,6 +324,7 @@ version 2.</p>
</li>
<li class="toctree-l1"><a class="reference internal" href="libnghttp2_asio.html">libnghttp2_asio: High level HTTP/2 C++ library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#server-api">Server API</a></li>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#client-api">Client API</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="python-apiref.html">Python API Reference</a><ul>
@ -322,6 +334,8 @@ version 2.</p>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2.h.html">nghttp2.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2ver.h.html">nghttp2ver.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_server.h.html">asio_http2_server.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_client.h.html">asio_http2_client.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2.h.html">asio_http2.h</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2">Source</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2/issues">Issues</a></li>
@ -378,7 +392,7 @@ version 2.</p>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.7.2-DEV',
VERSION:'0.7.8-DEV',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: false

View File

@ -7,7 +7,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>libnghttp2_asio: High level HTTP/2 C++ library &mdash; nghttp2 0.7.2-DEV documentation</title>
<title>libnghttp2_asio: High level HTTP/2 C++ library &mdash; nghttp2 0.7.8-DEV documentation</title>
@ -28,7 +28,7 @@
<link rel="top" title="nghttp2 0.7.2-DEV documentation" href="index.html"/>
<link rel="top" title="nghttp2 0.7.8-DEV documentation" href="index.html"/>
<link rel="next" title="Python API Reference" href="python-apiref.html"/>
<link rel="prev" title="API Reference" href="apiref.html"/>
@ -100,30 +100,33 @@
<li class="toctree-l1"><a class="reference internal" href="nghttp.1.html">nghttp(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpd.1.html">nghttpd(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpx.1.html">nghttpx(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#files">FILES</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#signals">SIGNALS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#server-push">SERVER PUSH</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#unix-domain-socket">UNIX DOMAIN SOCKET</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load.1.html">h2load(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#output">OUTPUT</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
@ -139,7 +142,7 @@
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#rewriting-location-header-field">Rewriting location header field</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#hot-swapping">Hot swapping</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#re-opening-log-files">Re-opening log files</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-http-1-backend-addresses">Multiple HTTP/1 backend addresses</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-backend-addresses">Multiple backend addresses</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load-howto.html">h2load - HTTP/2 benchmarking tool - HOW-TO</a><ul>
@ -153,6 +156,7 @@
<li class="toctree-l1"><a class="reference internal" href="apiref.html">API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#includes">Includes</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#remarks">Remarks</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#http-messaging">HTTP Messaging</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#macros">Macros</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#enums">Enums</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#types-structs-unions-and-typedefs">Types (structs, unions and typedefs)</a></li>
@ -161,6 +165,7 @@
</li>
<li class="toctree-l1 current"><a class="current reference internal" href="">libnghttp2_asio: High level HTTP/2 C++ library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#server-api">Server API</a></li>
<li class="toctree-l2"><a class="reference internal" href="#client-api">Client API</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="python-apiref.html">Python API Reference</a><ul>
@ -170,6 +175,8 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2.h.html">nghttp2.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2ver.h.html">nghttp2ver.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_server.h.html">asio_http2_server.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_client.h.html">asio_http2_client.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2.h.html">asio_http2.h</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2">Source</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2/issues">Issues</a></li>
@ -212,7 +219,7 @@
<p>libnghttp2_asio is C++ library built on top of libnghttp2 and provides
high level abstraction API to build HTTP/2 applications. It depends
on Boost::ASIO library and OpenSSL. Currently libnghttp2_asio
provides server side API.</p>
provides server and client side API.</p>
<p>libnghttp2_asio is not built by default. Use <tt class="docutils literal"><span class="pre">--enable-asio-lib</span></tt>
configure flag to build libnghttp2_asio. The required Boost libraries
are:</p>
@ -221,36 +228,57 @@ are:</p>
<li>Boost::System</li>
<li>Boost::Thread</li>
</ul>
<p>To use libnghttp2_asio, first include following header file:</p>
<div class="highlight-cpp"><div class="highlight"><pre><span class="cp">#include &lt;nghttp2/asio_http2.h&gt;</span>
<p>We have 3 header files for this library:</p>
<ul class="simple">
<li><a class="reference internal" href="asio_http2_server.h.html"><em>asio_http2_server.h</em></a></li>
<li><a class="reference internal" href="asio_http2_client.h.html"><em>asio_http2_client.h</em></a></li>
<li><a class="reference internal" href="asio_http2.h.html"><em>asio_http2.h</em></a></li>
</ul>
<p>asio_http2.h is included from the other two files.</p>
<p>To build a program with libnghttp2_asio, link to the following
libraries:</p>
<div class="highlight-c"><div class="highlight"><pre><span class="o">-</span><span class="n">lnghttp2_asio</span> <span class="o">-</span><span class="n">lboost_system</span>
</pre></div>
</div>
<p>If <tt class="docutils literal"><span class="pre">boost::asio::ssl</span></tt> is used in application code, OpenSSL is also
required in link line:</p>
<div class="highlight-c"><div class="highlight"><pre><span class="o">-</span><span class="n">lnghttp2_asio</span> <span class="o">-</span><span class="n">lboost_system</span> <span class="o">-</span><span class="n">lssl</span> <span class="o">-</span><span class="n">lcrypto</span>
</pre></div>
</div>
<p>Also take a look at that header file <a class="reference internal" href="asio_http2.h.html"><em>asio_http2.h</em></a>.</p>
<div class="section" id="server-api">
<h2>Server API<a class="headerlink" href="#server-api" title="Permalink to this headline"></a></h2>
<p>To use server API, first include following header file:</p>
<div class="highlight-cpp"><div class="highlight"><pre><span class="cp">#include &lt;nghttp2/asio_http2_server.h&gt;</span>
</pre></div>
</div>
<p>Also take a look at that header file <a class="reference internal" href="asio_http2_server.h.html"><em>asio_http2_server.h</em></a>.</p>
<p>Server API is designed to build HTTP/2 server very easily to utilize
C++11 anonymous function and closure. The bare minimum example of
HTTP/2 server looks like this:</p>
<div class="highlight-cpp"><div class="highlight"><pre><span class="cp">#include &lt;nghttp2/asio_http2.h&gt;</span>
<span class="k">using</span> <span class="k">namespace</span> <span class="n">nghttp2</span><span class="o">::</span><span class="n">asio_http2</span><span class="p">;</span>
<div class="highlight-cpp"><div class="highlight"><pre><span class="k">using</span> <span class="k">namespace</span> <span class="n">nghttp2</span><span class="o">::</span><span class="n">asio_http2</span><span class="p">;</span>
<span class="k">using</span> <span class="k">namespace</span> <span class="n">nghttp2</span><span class="o">::</span><span class="n">asio_http2</span><span class="o">::</span><span class="n">server</span><span class="p">;</span>
<span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span> <span class="o">*</span><span class="n">argv</span><span class="p">[])</span> <span class="p">{</span>
<span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_code</span> <span class="n">ec</span><span class="p">;</span>
<span class="n">http2</span> <span class="n">server</span><span class="p">;</span>
<span class="n">server</span><span class="p">.</span><span class="n">listen</span><span class="p">(</span><span class="s">&quot;*&quot;</span><span class="p">,</span> <span class="mi">3000</span><span class="p">,</span> <span class="p">[](</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">shared_ptr</span><span class="o">&lt;</span><span class="n">request</span><span class="o">&gt;</span> <span class="o">&amp;</span><span class="n">req</span><span class="p">,</span>
<span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">shared_ptr</span><span class="o">&lt;</span><span class="n">response</span><span class="o">&gt;</span> <span class="o">&amp;</span><span class="n">res</span><span class="p">)</span> <span class="p">{</span>
<span class="n">res</span><span class="o">-&gt;</span><span class="n">write_head</span><span class="p">(</span><span class="mi">200</span><span class="p">);</span>
<span class="n">res</span><span class="o">-&gt;</span><span class="n">end</span><span class="p">(</span><span class="s">&quot;hello, world&quot;</span><span class="p">);</span>
<span class="n">server</span><span class="p">.</span><span class="n">handle</span><span class="p">(</span><span class="s">&quot;/&quot;</span><span class="p">,</span> <span class="p">[](</span><span class="k">const</span> <span class="n">request</span> <span class="o">&amp;</span><span class="n">req</span><span class="p">,</span> <span class="k">const</span> <span class="n">response</span> <span class="o">&amp;</span><span class="n">res</span><span class="p">)</span> <span class="p">{</span>
<span class="n">res</span><span class="p">.</span><span class="n">write_head</span><span class="p">(</span><span class="mi">200</span><span class="p">);</span>
<span class="n">res</span><span class="p">.</span><span class="n">end</span><span class="p">(</span><span class="s">&quot;hello, world</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="p">});</span>
<span class="k">if</span> <span class="p">(</span><span class="n">server</span><span class="p">.</span><span class="n">listen_and_serve</span><span class="p">(</span><span class="n">ec</span><span class="p">,</span> <span class="s">&quot;localhost&quot;</span><span class="p">,</span> <span class="s">&quot;3000&quot;</span><span class="p">))</span> <span class="p">{</span>
<span class="n">std</span><span class="o">::</span><span class="n">cerr</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;error: &quot;</span> <span class="o">&lt;&lt;</span> <span class="n">ec</span><span class="p">.</span><span class="n">message</span><span class="p">()</span> <span class="o">&lt;&lt;</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
<p>First we instantiate <tt class="docutils literal"><span class="pre">nghttp2::asio_http2::server::http2</span></tt> object.
Then call <tt class="docutils literal"><span class="pre">nghttp2::asio_http2::server::http2::listen</span></tt> function with
address and port to listen to and callback function, namely &quot;request
callback&quot;, invoked when request arrives.</p>
<tt class="docutils literal"><span class="pre">nghttp2::asio_http2::server::http2::handle</span></tt> function registers
pattern and its handler function. In this example, we register &quot;/&quot; as
pattern, which matches all requests. Then call
<tt class="docutils literal"><span class="pre">nghttp2::asio_http2::server::http2::listen_and_serve</span></tt> function with
address and port to listen to.</p>
<p>The <tt class="docutils literal"><span class="pre">req</span></tt> and <tt class="docutils literal"><span class="pre">res</span></tt> represent HTTP request and response
respectively. <tt class="docutils literal"><span class="pre">nghttp2::asio_http2_::server::response::write_head</span></tt>
constructs HTTP response header fields. The first argument is HTTP
@ -259,87 +287,109 @@ which is omitted in the above example, is additional header fields to
send.</p>
<p><tt class="docutils literal"><span class="pre">nghttp2::asio_http2::server::response::end</span></tt> sends responde body.
In the above example, we send string &quot;hello, world&quot;.</p>
<p>The life time of req and res object ends after the callback set by
<tt class="docutils literal"><span class="pre">nghttp2::asio_http2::server::response::on_close</span></tt> function.
Application must not use those objects after this call.</p>
<div class="section" id="serving-static-files-and-enabling-ssl-tls">
<h3>Serving static files and enabling SSL/TLS<a class="headerlink" href="#serving-static-files-and-enabling-ssl-tls" title="Permalink to this headline"></a></h3>
<p>In this example, we serve a couple of static files and also enable
SSL/TLS.</p>
<div class="highlight-cpp"><div class="highlight"><pre><span class="cp">#include &lt;nghttp2/asio_http2.h&gt;</span>
<div class="highlight-cpp"><div class="highlight"><pre><span class="cp">#include &lt;nghttp2/asio_http2_server.h&gt;</span>
<span class="k">using</span> <span class="k">namespace</span> <span class="n">nghttp2</span><span class="o">::</span><span class="n">asio_http2</span><span class="p">;</span>
<span class="k">using</span> <span class="k">namespace</span> <span class="n">nghttp2</span><span class="o">::</span><span class="n">asio_http2</span><span class="o">::</span><span class="n">server</span><span class="p">;</span>
<span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span> <span class="o">*</span><span class="n">argv</span><span class="p">[])</span> <span class="p">{</span>
<span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_code</span> <span class="n">ec</span><span class="p">;</span>
<span class="n">boost</span><span class="o">::</span><span class="n">asio</span><span class="o">::</span><span class="n">ssl</span><span class="o">::</span><span class="n">context</span> <span class="n">tls</span><span class="p">(</span><span class="n">boost</span><span class="o">::</span><span class="n">asio</span><span class="o">::</span><span class="n">ssl</span><span class="o">::</span><span class="n">context</span><span class="o">::</span><span class="n">sslv23</span><span class="p">);</span>
<span class="n">tls</span><span class="p">.</span><span class="n">use_private_key_file</span><span class="p">(</span><span class="s">&quot;server.key&quot;</span><span class="p">,</span> <span class="n">boost</span><span class="o">::</span><span class="n">asio</span><span class="o">::</span><span class="n">ssl</span><span class="o">::</span><span class="n">context</span><span class="o">::</span><span class="n">pem</span><span class="p">);</span>
<span class="n">tls</span><span class="p">.</span><span class="n">use_certificate_chain_file</span><span class="p">(</span><span class="s">&quot;server.crt&quot;</span><span class="p">);</span>
<span class="n">configure_tls_context_easy</span><span class="p">(</span><span class="n">ec</span><span class="p">,</span> <span class="n">tls</span><span class="p">);</span>
<span class="n">http2</span> <span class="n">server</span><span class="p">;</span>
<span class="n">server</span><span class="p">.</span><span class="n">tls</span><span class="p">(</span><span class="s">&quot;server.key&quot;</span><span class="p">,</span> <span class="s">&quot;server.crt&quot;</span><span class="p">);</span>
<span class="n">server</span><span class="p">.</span><span class="n">listen</span><span class="p">(</span><span class="s">&quot;*&quot;</span><span class="p">,</span> <span class="mi">3000</span><span class="p">,</span> <span class="p">[](</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">shared_ptr</span><span class="o">&lt;</span><span class="n">request</span><span class="o">&gt;</span> <span class="o">&amp;</span><span class="n">req</span><span class="p">,</span>
<span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">shared_ptr</span><span class="o">&lt;</span><span class="n">response</span><span class="o">&gt;</span> <span class="o">&amp;</span><span class="n">res</span><span class="p">)</span> <span class="p">{</span>
<span class="k">if</span> <span class="p">(</span><span class="n">req</span><span class="o">-&gt;</span><span class="n">path</span><span class="p">()</span> <span class="o">==</span> <span class="s">&quot;/&quot;</span> <span class="o">||</span> <span class="n">req</span><span class="o">-&gt;</span><span class="n">path</span><span class="p">()</span> <span class="o">==</span> <span class="s">&quot;/index.html&quot;</span><span class="p">)</span> <span class="p">{</span>
<span class="n">res</span><span class="o">-&gt;</span><span class="n">write_head</span><span class="p">(</span><span class="mi">200</span><span class="p">);</span>
<span class="n">res</span><span class="o">-&gt;</span><span class="n">end</span><span class="p">(</span><span class="n">file_reader</span><span class="p">(</span><span class="s">&quot;index.html&quot;</span><span class="p">));</span>
<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
<span class="n">res</span><span class="o">-&gt;</span><span class="n">write_head</span><span class="p">(</span><span class="mi">404</span><span class="p">);</span>
<span class="n">res</span><span class="o">-&gt;</span><span class="n">end</span><span class="p">(</span><span class="s">&quot;&lt;html&gt;&lt;head&gt;&lt;title&gt;404&lt;/title&gt;&lt;/head&gt;&quot;</span>
<span class="s">&quot;&lt;body&gt;404 Not Found&lt;/body&gt;&lt;/html&gt;&quot;</span><span class="p">);</span>
<span class="p">}</span>
<span class="n">server</span><span class="p">.</span><span class="n">handle</span><span class="p">(</span><span class="s">&quot;/index.html&quot;</span><span class="p">,</span> <span class="p">[](</span><span class="k">const</span> <span class="n">request</span> <span class="o">&amp;</span><span class="n">req</span><span class="p">,</span> <span class="k">const</span> <span class="n">response</span> <span class="o">&amp;</span><span class="n">res</span><span class="p">)</span> <span class="p">{</span>
<span class="n">res</span><span class="p">.</span><span class="n">write_head</span><span class="p">(</span><span class="mi">200</span><span class="p">);</span>
<span class="n">res</span><span class="p">.</span><span class="n">end</span><span class="p">(</span><span class="n">file_generator</span><span class="p">(</span><span class="s">&quot;index.html&quot;</span><span class="p">));</span>
<span class="p">});</span>
<span class="k">if</span> <span class="p">(</span><span class="n">server</span><span class="p">.</span><span class="n">listen_and_serve</span><span class="p">(</span><span class="n">ec</span><span class="p">,</span> <span class="n">tls</span><span class="p">,</span> <span class="s">&quot;localhost&quot;</span><span class="p">,</span> <span class="s">&quot;3000&quot;</span><span class="p">))</span> <span class="p">{</span>
<span class="n">std</span><span class="o">::</span><span class="n">cerr</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;error: &quot;</span> <span class="o">&lt;&lt;</span> <span class="n">ec</span><span class="p">.</span><span class="n">message</span><span class="p">()</span> <span class="o">&lt;&lt;</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
<p>Specifying path to private key file and certificate file in
<tt class="docutils literal"><span class="pre">nghttp2::asio_http2::server::http2::tls</span></tt> will enable SSL/TLS. Both
files must be in PEM format.</p>
<p>In the above example, if request path is either &quot;/&quot; or &quot;/index.html&quot;,
we serve index.html file in the current working directory.
<p>We first create <tt class="docutils literal"><span class="pre">boost::asio::ssl::context</span></tt> object and set path to
private key file and certificate file.
<tt class="docutils literal"><span class="pre">nghttp2::asio_http2::server::configure_tls_context_easy</span></tt> function
configures SSL/TLS context object for HTTP/2 server use, including NPN
callbacks.</p>
<p>In the above example, if request path is &quot;/index.html&quot;, we serve
index.html file in the current working directory.
<tt class="docutils literal"><span class="pre">nghttp2::asio_http2::server::response::end</span></tt> has overload to take
function of type <tt class="docutils literal"><span class="pre">nghttp2::asio_http2::read_cb</span></tt> and application pass
its implementation to generate response body. For the convenience,
libnghttp2_asio library provides <tt class="docutils literal"><span class="pre">nghttp2::asio_http2::file_reader</span></tt>
function to generate function to server static file.</p>
function of type <tt class="docutils literal"><span class="pre">nghttp2::asio_http2::generator_cb</span></tt> and application
pass its implementation to generate response body. For the
convenience, libnghttp2_asio library provides
<tt class="docutils literal"><span class="pre">nghttp2::asio_http2::file_generator</span></tt> function to generate function
to server static file. If other resource is requested, server
automatically responds with 404 status code.</p>
</div>
<div class="section" id="server-push">
<h3>Server push<a class="headerlink" href="#server-push" title="Permalink to this headline"></a></h3>
<p>Server push is also supported.</p>
<div class="highlight-cpp"><div class="highlight"><pre><span class="cp">#include &lt;nghttp2/asio_http2.h&gt;</span>
<div class="highlight-cpp"><div class="highlight"><pre><span class="cp">#include &lt;nghttp2/asio_http2_server.h&gt;</span>
<span class="k">using</span> <span class="k">namespace</span> <span class="n">nghttp2</span><span class="o">::</span><span class="n">asio_http2</span><span class="p">;</span>
<span class="k">using</span> <span class="k">namespace</span> <span class="n">nghttp2</span><span class="o">::</span><span class="n">asio_http2</span><span class="o">::</span><span class="n">server</span><span class="p">;</span>
<span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span> <span class="o">*</span><span class="n">argv</span><span class="p">[])</span> <span class="p">{</span>
<span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_code</span> <span class="n">ec</span><span class="p">;</span>
<span class="n">boost</span><span class="o">::</span><span class="n">asio</span><span class="o">::</span><span class="n">ssl</span><span class="o">::</span><span class="n">context</span> <span class="n">tls</span><span class="p">(</span><span class="n">boost</span><span class="o">::</span><span class="n">asio</span><span class="o">::</span><span class="n">ssl</span><span class="o">::</span><span class="n">context</span><span class="o">::</span><span class="n">sslv23</span><span class="p">);</span>
<span class="n">tls</span><span class="p">.</span><span class="n">use_private_key_file</span><span class="p">(</span><span class="s">&quot;server.key&quot;</span><span class="p">,</span> <span class="n">boost</span><span class="o">::</span><span class="n">asio</span><span class="o">::</span><span class="n">ssl</span><span class="o">::</span><span class="n">context</span><span class="o">::</span><span class="n">pem</span><span class="p">);</span>
<span class="n">tls</span><span class="p">.</span><span class="n">use_certificate_chain_file</span><span class="p">(</span><span class="s">&quot;server.crt&quot;</span><span class="p">);</span>
<span class="n">configure_tls_context_easy</span><span class="p">(</span><span class="n">ec</span><span class="p">,</span> <span class="n">tls</span><span class="p">);</span>
<span class="n">http2</span> <span class="n">server</span><span class="p">;</span>
<span class="n">server</span><span class="p">.</span><span class="n">tls</span><span class="p">(</span><span class="s">&quot;server.key&quot;</span><span class="p">,</span> <span class="s">&quot;server.crt&quot;</span><span class="p">);</span>
<span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">style_css</span> <span class="o">=</span> <span class="s">&quot;h1 { color: green; }&quot;</span><span class="p">;</span>
<span class="n">server</span><span class="p">.</span><span class="n">listen</span><span class="p">(</span><span class="s">&quot;*&quot;</span><span class="p">,</span> <span class="mi">3000</span><span class="p">,</span> <span class="p">[](</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">shared_ptr</span><span class="o">&lt;</span><span class="n">request</span><span class="o">&gt;</span> <span class="o">&amp;</span><span class="n">req</span><span class="p">,</span>
<span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">shared_ptr</span><span class="o">&lt;</span><span class="n">response</span><span class="o">&gt;</span> <span class="o">&amp;</span><span class="n">res</span><span class="p">)</span> <span class="p">{</span>
<span class="k">if</span> <span class="p">(</span><span class="n">req</span><span class="o">-&gt;</span><span class="n">path</span><span class="p">()</span> <span class="o">==</span> <span class="s">&quot;/&quot;</span><span class="p">)</span> <span class="p">{</span>
<span class="n">req</span><span class="o">-&gt;</span><span class="n">push</span><span class="p">(</span><span class="s">&quot;GET&quot;</span><span class="p">,</span> <span class="s">&quot;/my.css&quot;</span><span class="p">);</span>
<span class="n">server</span><span class="p">.</span><span class="n">handle</span><span class="p">(</span><span class="s">&quot;/&quot;</span><span class="p">,</span> <span class="p">[</span><span class="o">&amp;</span><span class="n">style_css</span><span class="p">](</span><span class="k">const</span> <span class="n">request</span> <span class="o">&amp;</span><span class="n">req</span><span class="p">,</span> <span class="k">const</span> <span class="n">response</span> <span class="o">&amp;</span><span class="n">res</span><span class="p">)</span> <span class="p">{</span>
<span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_code</span> <span class="n">ec</span><span class="p">;</span>
<span class="k">auto</span> <span class="n">push</span> <span class="o">=</span> <span class="n">res</span><span class="p">.</span><span class="n">push</span><span class="p">(</span><span class="n">ec</span><span class="p">,</span> <span class="s">&quot;GET&quot;</span><span class="p">,</span> <span class="s">&quot;/style.css&quot;</span><span class="p">);</span>
<span class="n">push</span><span class="o">-&gt;</span><span class="n">write_head</span><span class="p">(</span><span class="mi">200</span><span class="p">);</span>
<span class="n">push</span><span class="o">-&gt;</span><span class="n">end</span><span class="p">(</span><span class="n">style_css</span><span class="p">);</span>
<span class="n">res</span><span class="o">-&gt;</span><span class="n">write_head</span><span class="p">(</span><span class="mi">200</span><span class="p">);</span>
<span class="n">res</span><span class="o">-&gt;</span><span class="n">end</span><span class="p">(</span><span class="n">file_reader</span><span class="p">(</span><span class="s">&quot;index.html&quot;</span><span class="p">));</span>
<span class="k">return</span><span class="p">;</span>
<span class="p">}</span>
<span class="k">if</span> <span class="p">(</span><span class="n">req</span><span class="o">-&gt;</span><span class="n">path</span><span class="p">()</span> <span class="o">==</span> <span class="s">&quot;/my.css&quot;</span><span class="p">)</span> <span class="p">{</span>
<span class="n">res</span><span class="o">-&gt;</span><span class="n">write_head</span><span class="p">(</span><span class="mi">200</span><span class="p">);</span>
<span class="n">res</span><span class="o">-&gt;</span><span class="n">end</span><span class="p">(</span><span class="n">file_reader</span><span class="p">(</span><span class="s">&quot;my.css&quot;</span><span class="p">));</span>
<span class="k">return</span><span class="p">;</span>
<span class="p">}</span>
<span class="n">res</span><span class="o">-&gt;</span><span class="n">write_head</span><span class="p">(</span><span class="mi">404</span><span class="p">);</span>
<span class="n">res</span><span class="o">-&gt;</span><span class="n">end</span><span class="p">(</span><span class="s">&quot;&lt;html&gt;&lt;head&gt;&lt;title&gt;404&lt;/title&gt;&lt;/head&gt;&quot;</span>
<span class="s">&quot;&lt;body&gt;404 Not Found&lt;/body&gt;&lt;/html&gt;&quot;</span><span class="p">);</span>
<span class="n">res</span><span class="p">.</span><span class="n">write_head</span><span class="p">(</span><span class="mi">200</span><span class="p">);</span>
<span class="n">res</span><span class="p">.</span><span class="n">end</span><span class="p">(</span><span class="n">R</span><span class="s">&quot;(</span>
<span class="o">&lt;!</span><span class="n">DOCTYPE</span> <span class="n">html</span><span class="o">&gt;&lt;</span><span class="n">html</span> <span class="n">lang</span><span class="o">=</span><span class="s">&quot;en&quot;</span><span class="o">&gt;</span>
<span class="o">&lt;</span><span class="n">title</span><span class="o">&gt;</span><span class="n">HTTP</span><span class="o">/</span><span class="mi">2</span> <span class="n">FTW</span><span class="o">&lt;/</span><span class="n">title</span><span class="o">&gt;&lt;</span><span class="n">body</span><span class="o">&gt;</span>
<span class="o">&lt;</span><span class="n">link</span> <span class="n">href</span><span class="o">=</span><span class="s">&quot;/style.css&quot;</span> <span class="n">rel</span><span class="o">=</span><span class="s">&quot;stylesheet&quot;</span> <span class="n">type</span><span class="o">=</span><span class="s">&quot;text/css&quot;</span><span class="o">&gt;</span>
<span class="o">&lt;</span><span class="n">h1</span><span class="o">&gt;</span><span class="n">This</span> <span class="n">should</span> <span class="n">be</span> <span class="n">green</span><span class="o">&lt;/</span><span class="n">h1</span><span class="o">&gt;</span>
<span class="o">&lt;/</span><span class="n">body</span><span class="o">&gt;&lt;/</span><span class="n">html</span><span class="o">&gt;</span>
<span class="p">)</span><span class="s">&quot;);</span>
<span class="p">});</span>
<span class="n">server</span><span class="p">.</span><span class="n">handle</span><span class="p">(</span><span class="s">&quot;/style.css&quot;</span><span class="p">,</span>
<span class="p">[</span><span class="o">&amp;</span><span class="n">style_css</span><span class="p">](</span><span class="k">const</span> <span class="n">request</span> <span class="o">&amp;</span><span class="n">req</span><span class="p">,</span> <span class="k">const</span> <span class="n">response</span> <span class="o">&amp;</span><span class="n">res</span><span class="p">)</span> <span class="p">{</span>
<span class="n">res</span><span class="p">.</span><span class="n">write_head</span><span class="p">(</span><span class="mi">200</span><span class="p">);</span>
<span class="n">res</span><span class="p">.</span><span class="n">end</span><span class="p">(</span><span class="n">style_css</span><span class="p">);</span>
<span class="p">});</span>
<span class="k">if</span> <span class="p">(</span><span class="n">server</span><span class="p">.</span><span class="n">listen_and_serve</span><span class="p">(</span><span class="n">ec</span><span class="p">,</span> <span class="n">tls</span><span class="p">,</span> <span class="s">&quot;localhost&quot;</span><span class="p">,</span> <span class="s">&quot;3000&quot;</span><span class="p">))</span> <span class="p">{</span>
<span class="n">std</span><span class="o">::</span><span class="n">cerr</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;error: &quot;</span> <span class="o">&lt;&lt;</span> <span class="n">ec</span><span class="p">.</span><span class="n">message</span><span class="p">()</span> <span class="o">&lt;&lt;</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
<p>When client requested &quot;/&quot;, we push &quot;/my.css&quot;. To push resource, call
<tt class="docutils literal"><span class="pre">nghttp2::asio_http2::server::request::push</span></tt> function with desired
method and path. Later, the callback will be called with the pushed
resource &quot;/my.css&quot;.</p>
<p>When client requested any resource other than &quot;/style.css&quot;, we push
&quot;/style.css&quot;. To push resource, call
<tt class="docutils literal"><span class="pre">nghttp2::asio_http2::server::response::push</span></tt> function with desired
method and path. It returns another response object and use its
functions to send push response.</p>
</div>
<div class="section" id="enable-multi-threading">
<h3>Enable multi-threading<a class="headerlink" href="#enable-multi-threading" title="Permalink to this headline"></a></h3>
@ -353,63 +403,214 @@ desired number of threads:</p>
</pre></div>
</div>
</div>
<div class="section" id="run-blocking-tasks-in-background-thread">
<h3>Run blocking tasks in background thread<a class="headerlink" href="#run-blocking-tasks-in-background-thread" title="Permalink to this headline"></a></h3>
<p>The request callback is called in the same thread where HTTP request
is handled. And many connections shares the same thread, we cannot
directly run blocking tasks in request callback.</p>
<p>To run blocking tasks, use
<tt class="docutils literal"><span class="pre">nghttp2::asio_http2::server::request::run_task</span></tt>. The passed
callback will be executed in the different thread from the thread
where request callback was executed. So application can perform
blocking task there. The example follows:</p>
<div class="highlight-cpp"><div class="highlight"><pre><span class="cp">#include &lt;unistd.h&gt;</span>
<span class="cp">#include &lt;nghttp2/asio_http2.h&gt;</span>
</div>
<div class="section" id="client-api">
<h2>Client API<a class="headerlink" href="#client-api" title="Permalink to this headline"></a></h2>
<p>To use client API, first include following header file:</p>
<div class="highlight-cpp"><div class="highlight"><pre><span class="cp">#include &lt;nghttp2/asio_http2_client.h&gt;</span>
</pre></div>
</div>
<p>Also take a look at that header file <a class="reference internal" href="asio_http2_client.h.html"><em>asio_http2_client.h</em></a>.</p>
<p>Here is the sample client code to access HTTP/2 server and print out
response header fields and response body to the console screen:</p>
<div class="highlight-cpp"><div class="highlight"><pre><span class="cp">#include &lt;iostream&gt;</span>
<span class="cp">#include &lt;nghttp2/asio_http2_client.h&gt;</span>
<span class="k">using</span> <span class="n">boost</span><span class="o">::</span><span class="n">asio</span><span class="o">::</span><span class="n">ip</span><span class="o">::</span><span class="n">tcp</span><span class="p">;</span>
<span class="k">using</span> <span class="k">namespace</span> <span class="n">nghttp2</span><span class="o">::</span><span class="n">asio_http2</span><span class="p">;</span>
<span class="k">using</span> <span class="k">namespace</span> <span class="n">nghttp2</span><span class="o">::</span><span class="n">asio_http2</span><span class="o">::</span><span class="n">server</span><span class="p">;</span>
<span class="k">using</span> <span class="k">namespace</span> <span class="n">nghttp2</span><span class="o">::</span><span class="n">asio_http2</span><span class="o">::</span><span class="n">client</span><span class="p">;</span>
<span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span> <span class="o">*</span><span class="n">argv</span><span class="p">[])</span> <span class="p">{</span>
<span class="n">http2</span> <span class="n">server</span><span class="p">;</span>
<span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_code</span> <span class="n">ec</span><span class="p">;</span>
<span class="n">boost</span><span class="o">::</span><span class="n">asio</span><span class="o">::</span><span class="n">io_service</span> <span class="n">io_service</span><span class="p">;</span>
<span class="n">server</span><span class="p">.</span><span class="n">num_concurrent_tasks</span><span class="p">(</span><span class="mi">16</span><span class="p">);</span>
<span class="c1">// connect to localhost:3000</span>
<span class="n">session</span> <span class="n">sess</span><span class="p">(</span><span class="n">io_service</span><span class="p">,</span> <span class="s">&quot;localhost&quot;</span><span class="p">,</span> <span class="s">&quot;3000&quot;</span><span class="p">);</span>
<span class="n">server</span><span class="p">.</span><span class="n">listen</span><span class="p">(</span><span class="s">&quot;*&quot;</span><span class="p">,</span> <span class="mi">3000</span><span class="p">,</span> <span class="p">[](</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">shared_ptr</span><span class="o">&lt;</span><span class="n">request</span><span class="o">&gt;</span> <span class="o">&amp;</span><span class="n">req</span><span class="p">,</span>
<span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">shared_ptr</span><span class="o">&lt;</span><span class="n">response</span><span class="o">&gt;</span> <span class="o">&amp;</span><span class="n">res</span><span class="p">)</span> <span class="p">{</span>
<span class="n">req</span><span class="o">-&gt;</span><span class="n">run_task</span><span class="p">([</span><span class="n">res</span><span class="p">](</span><span class="n">channel</span> <span class="o">&amp;</span><span class="n">channel</span><span class="p">)</span> <span class="p">{</span>
<span class="c1">// executed in different thread than the thread where</span>
<span class="c1">// request callback was executed.</span>
<span class="n">sess</span><span class="p">.</span><span class="n">on_connect</span><span class="p">([</span><span class="o">&amp;</span><span class="n">sess</span><span class="p">](</span><span class="n">tcp</span><span class="o">::</span><span class="n">resolver</span><span class="o">::</span><span class="n">iterator</span> <span class="n">endpoint_it</span><span class="p">)</span> <span class="p">{</span>
<span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_code</span> <span class="n">ec</span><span class="p">;</span>
<span class="c1">// using res directly here is not safe. Capturing it by</span>
<span class="c1">// value is safe because it is std::shared_ptr.</span>
<span class="k">auto</span> <span class="n">req</span> <span class="o">=</span> <span class="n">sess</span><span class="p">.</span><span class="n">submit</span><span class="p">(</span><span class="n">ec</span><span class="p">,</span> <span class="s">&quot;GET&quot;</span><span class="p">,</span> <span class="s">&quot;http://localhost:3000/&quot;</span><span class="p">);</span>
<span class="n">sleep</span><span class="p">(</span><span class="mi">1</span><span class="p">);</span>
<span class="n">req</span><span class="o">-&gt;</span><span class="n">on_response</span><span class="p">([](</span><span class="k">const</span> <span class="n">response</span> <span class="o">&amp;</span><span class="n">res</span><span class="p">)</span> <span class="p">{</span>
<span class="c1">// print status code and response header fields.</span>
<span class="n">std</span><span class="o">::</span><span class="n">cerr</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;HTTP/2 &quot;</span> <span class="o">&lt;&lt;</span> <span class="n">res</span><span class="p">.</span><span class="n">status_code</span><span class="p">()</span> <span class="o">&lt;&lt;</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
<span class="k">for</span> <span class="p">(</span><span class="k">auto</span> <span class="o">&amp;</span><span class="nl">kv</span> <span class="p">:</span> <span class="n">res</span><span class="p">.</span><span class="n">header</span><span class="p">())</span> <span class="p">{</span>
<span class="n">std</span><span class="o">::</span><span class="n">cerr</span> <span class="o">&lt;&lt;</span> <span class="n">kv</span><span class="p">.</span><span class="n">first</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;: &quot;</span> <span class="o">&lt;&lt;</span> <span class="n">kv</span><span class="p">.</span><span class="n">second</span><span class="p">.</span><span class="n">value</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">;</span>
<span class="p">}</span>
<span class="n">std</span><span class="o">::</span><span class="n">cerr</span> <span class="o">&lt;&lt;</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
<span class="n">channel</span><span class="p">.</span><span class="n">post</span><span class="p">([</span><span class="n">res</span><span class="p">]()</span> <span class="p">{</span>
<span class="c1">// executed in the same thread where request callback</span>
<span class="c1">// was executed.</span>
<span class="n">res</span><span class="o">-&gt;</span><span class="n">write_head</span><span class="p">(</span><span class="mi">200</span><span class="p">);</span>
<span class="n">res</span><span class="o">-&gt;</span><span class="n">end</span><span class="p">(</span><span class="s">&quot;hello, world&quot;</span><span class="p">);</span>
<span class="n">res</span><span class="p">.</span><span class="n">on_data</span><span class="p">([](</span><span class="k">const</span> <span class="kt">uint8_t</span> <span class="o">*</span><span class="n">data</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="kt">size_t</span> <span class="n">len</span><span class="p">)</span> <span class="p">{</span>
<span class="n">std</span><span class="o">::</span><span class="n">cerr</span><span class="p">.</span><span class="n">write</span><span class="p">(</span><span class="k">reinterpret_cast</span><span class="o">&lt;</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*&gt;</span><span class="p">(</span><span class="n">data</span><span class="p">),</span> <span class="n">len</span><span class="p">);</span>
<span class="n">std</span><span class="o">::</span><span class="n">cerr</span> <span class="o">&lt;&lt;</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
<span class="p">});</span>
<span class="p">});</span>
<span class="n">req</span><span class="o">-&gt;</span><span class="n">on_close</span><span class="p">([</span><span class="o">&amp;</span><span class="n">sess</span><span class="p">](</span><span class="kt">uint32_t</span> <span class="n">error_code</span><span class="p">)</span> <span class="p">{</span>
<span class="c1">// shutdown session after first request was done.</span>
<span class="n">sess</span><span class="p">.</span><span class="n">shutdown</span><span class="p">();</span>
<span class="p">});</span>
<span class="p">});</span>
<span class="n">sess</span><span class="p">.</span><span class="n">on_error</span><span class="p">([](</span><span class="k">const</span> <span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_code</span> <span class="o">&amp;</span><span class="n">ec</span><span class="p">)</span> <span class="p">{</span>
<span class="n">std</span><span class="o">::</span><span class="n">cerr</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;error: &quot;</span> <span class="o">&lt;&lt;</span> <span class="n">ec</span><span class="p">.</span><span class="n">message</span><span class="p">()</span> <span class="o">&lt;&lt;</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
<span class="p">});</span>
<span class="n">io_service</span><span class="p">.</span><span class="n">run</span><span class="p">();</span>
<span class="p">}</span>
</pre></div>
</div>
<p>First we set the number of background threads which run tasks. By
default it is set to 1. In this example, we set it to 16, so at most
16 tasks can be executed concurrently without blocking handling new
requests.</p>
<p>We call <tt class="docutils literal"><span class="pre">req-&gt;run_task()</span></tt> to execute task in background thread. In
the passed callback, we just simply sleeps 1 second. After sleep is
over, we schedule another callback to send response to the client.
Since the callback passed to <tt class="docutils literal"><span class="pre">req-&gt;run_task()</span></tt> is executed in the
different thread from the thread where request callback is called,
using <tt class="docutils literal"><span class="pre">req</span></tt> or <tt class="docutils literal"><span class="pre">res</span></tt> object directly there may cause undefined
behaviour. To avoid this issue, we can use
<tt class="docutils literal"><span class="pre">nghttp2::asio_http2::channel::post</span></tt> by supplying a callback which
in turn get called in the same thread where request callback was
called.</p>
<p><tt class="docutils literal"><span class="pre">nghttp2::asio_http2::client::session</span></tt> object takes
<tt class="docutils literal"><span class="pre">boost::asio::io_service</span></tt> object and remote server address. When
connection is made, the callback function passed to
<tt class="docutils literal"><span class="pre">nghttp2::asio_http2::client::on_connect</span></tt> is invoked with connected
address as its paramter. After this callback call, use
<tt class="docutils literal"><span class="pre">nghttp2::asio_http2::session::submit</span></tt> to send request to the
server. You can submit multiple requests at once without waiting for
the completion of previous request.</p>
<p>The life time of req and res object ends after the callback set by
<tt class="docutils literal"><span class="pre">nghttp2::asio_http2::server::request::on_close</span></tt> function.
Application must not use those objects after this call.</p>
<p>Normally, client does not stop even after all requests are done unless
connection is lost. To stop client, call
<tt class="docutils literal"><span class="pre">nghttp2::asio_http2::server::session::shutdown()</span></tt>.</p>
<div class="section" id="recieve-server-push-and-enable-ssl-tls">
<h3>Recieve server push and enable SSL/TLS<a class="headerlink" href="#recieve-server-push-and-enable-ssl-tls" title="Permalink to this headline"></a></h3>
<div class="highlight-cpp"><div class="highlight"><pre><span class="cp">#include &lt;iostream&gt;</span>
<span class="cp">#include &lt;nghttp2/asio_http2_client.h&gt;</span>
<span class="k">using</span> <span class="n">boost</span><span class="o">::</span><span class="n">asio</span><span class="o">::</span><span class="n">ip</span><span class="o">::</span><span class="n">tcp</span><span class="p">;</span>
<span class="k">using</span> <span class="k">namespace</span> <span class="n">nghttp2</span><span class="o">::</span><span class="n">asio_http2</span><span class="p">;</span>
<span class="k">using</span> <span class="k">namespace</span> <span class="n">nghttp2</span><span class="o">::</span><span class="n">asio_http2</span><span class="o">::</span><span class="n">client</span><span class="p">;</span>
<span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span> <span class="o">*</span><span class="n">argv</span><span class="p">[])</span> <span class="p">{</span>
<span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_code</span> <span class="n">ec</span><span class="p">;</span>
<span class="n">boost</span><span class="o">::</span><span class="n">asio</span><span class="o">::</span><span class="n">io_service</span> <span class="n">io_service</span><span class="p">;</span>
<span class="n">boost</span><span class="o">::</span><span class="n">asio</span><span class="o">::</span><span class="n">ssl</span><span class="o">::</span><span class="n">context</span> <span class="n">tls</span><span class="p">(</span><span class="n">boost</span><span class="o">::</span><span class="n">asio</span><span class="o">::</span><span class="n">ssl</span><span class="o">::</span><span class="n">context</span><span class="o">::</span><span class="n">sslv23</span><span class="p">);</span>
<span class="n">tls</span><span class="p">.</span><span class="n">set_default_verify_paths</span><span class="p">();</span>
<span class="c1">// disabled to make development easier...</span>
<span class="c1">// tls_ctx.set_verify_mode(boost::asio::ssl::verify_peer);</span>
<span class="n">configure_tls_context</span><span class="p">(</span><span class="n">ec</span><span class="p">,</span> <span class="n">tls</span><span class="p">);</span>
<span class="c1">// connect to localhost:3000</span>
<span class="n">session</span> <span class="n">sess</span><span class="p">(</span><span class="n">io_service</span><span class="p">,</span> <span class="n">tls</span><span class="p">,</span> <span class="s">&quot;localhost&quot;</span><span class="p">,</span> <span class="s">&quot;3000&quot;</span><span class="p">);</span>
<span class="n">sess</span><span class="p">.</span><span class="n">on_connect</span><span class="p">([</span><span class="o">&amp;</span><span class="n">sess</span><span class="p">](</span><span class="n">tcp</span><span class="o">::</span><span class="n">resolver</span><span class="o">::</span><span class="n">iterator</span> <span class="n">endpoint_it</span><span class="p">)</span> <span class="p">{</span>
<span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_code</span> <span class="n">ec</span><span class="p">;</span>
<span class="k">auto</span> <span class="n">req</span> <span class="o">=</span> <span class="n">sess</span><span class="p">.</span><span class="n">submit</span><span class="p">(</span><span class="n">ec</span><span class="p">,</span> <span class="s">&quot;GET&quot;</span><span class="p">,</span> <span class="s">&quot;http://localhost:3000/&quot;</span><span class="p">);</span>
<span class="n">req</span><span class="o">-&gt;</span><span class="n">on_response</span><span class="p">([</span><span class="o">&amp;</span><span class="n">sess</span><span class="p">](</span><span class="k">const</span> <span class="n">response</span> <span class="o">&amp;</span><span class="n">res</span><span class="p">)</span> <span class="p">{</span>
<span class="n">std</span><span class="o">::</span><span class="n">cerr</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;response received!&quot;</span> <span class="o">&lt;&lt;</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
<span class="n">res</span><span class="p">.</span><span class="n">on_data</span><span class="p">([</span><span class="o">&amp;</span><span class="n">sess</span><span class="p">](</span><span class="k">const</span> <span class="kt">uint8_t</span> <span class="o">*</span><span class="n">data</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="kt">size_t</span> <span class="n">len</span><span class="p">)</span> <span class="p">{</span>
<span class="n">std</span><span class="o">::</span><span class="n">cerr</span><span class="p">.</span><span class="n">write</span><span class="p">(</span><span class="k">reinterpret_cast</span><span class="o">&lt;</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*&gt;</span><span class="p">(</span><span class="n">data</span><span class="p">),</span> <span class="n">len</span><span class="p">);</span>
<span class="n">std</span><span class="o">::</span><span class="n">cerr</span> <span class="o">&lt;&lt;</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
<span class="p">});</span>
<span class="p">});</span>
<span class="n">req</span><span class="o">-&gt;</span><span class="n">on_push</span><span class="p">([](</span><span class="k">const</span> <span class="n">request</span> <span class="o">&amp;</span><span class="n">push</span><span class="p">)</span> <span class="p">{</span>
<span class="n">std</span><span class="o">::</span><span class="n">cerr</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;push request received!&quot;</span> <span class="o">&lt;&lt;</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
<span class="n">push</span><span class="p">.</span><span class="n">on_response</span><span class="p">([](</span><span class="k">const</span> <span class="n">response</span> <span class="o">&amp;</span><span class="n">res</span><span class="p">)</span> <span class="p">{</span>
<span class="n">std</span><span class="o">::</span><span class="n">cerr</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;push response received!&quot;</span> <span class="o">&lt;&lt;</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
<span class="n">res</span><span class="p">.</span><span class="n">on_data</span><span class="p">([](</span><span class="k">const</span> <span class="kt">uint8_t</span> <span class="o">*</span><span class="n">data</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="kt">size_t</span> <span class="n">len</span><span class="p">)</span> <span class="p">{</span>
<span class="n">std</span><span class="o">::</span><span class="n">cerr</span><span class="p">.</span><span class="n">write</span><span class="p">(</span><span class="k">reinterpret_cast</span><span class="o">&lt;</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*&gt;</span><span class="p">(</span><span class="n">data</span><span class="p">),</span> <span class="n">len</span><span class="p">);</span>
<span class="n">std</span><span class="o">::</span><span class="n">cerr</span> <span class="o">&lt;&lt;</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
<span class="p">});</span>
<span class="p">});</span>
<span class="p">});</span>
<span class="p">});</span>
<span class="n">sess</span><span class="p">.</span><span class="n">on_error</span><span class="p">([](</span><span class="k">const</span> <span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_code</span> <span class="o">&amp;</span><span class="n">ec</span><span class="p">)</span> <span class="p">{</span>
<span class="n">std</span><span class="o">::</span><span class="n">cerr</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;error: &quot;</span> <span class="o">&lt;&lt;</span> <span class="n">ec</span><span class="p">.</span><span class="n">message</span><span class="p">()</span> <span class="o">&lt;&lt;</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
<span class="p">});</span>
<span class="n">io_service</span><span class="p">.</span><span class="n">run</span><span class="p">();</span>
<span class="p">}</span>
</pre></div>
</div>
<p>The above sample code demonstrates how to enable SSL/TLS and receive
server push. Currently,
<tt class="docutils literal"><span class="pre">nghttp2::asio_http2::client::configure_tls_context</span></tt> function setups
NPN callbacks for SSL/TLS context for HTTP/2 use.</p>
<p>To receive server push, use
<tt class="docutils literal"><span class="pre">nghttp2::asio_http2::client::request::on_push</span></tt> function to set
callback function which is invoked when server push request is
arrived. The callback function takes
<tt class="docutils literal"><span class="pre">nghttp2::asio_http2::client::request</span></tt> object, which contains the
pushed request. To get server push response, set callback using
<tt class="docutils literal"><span class="pre">nghttp2::asio_http2::client::request::on_response</span></tt>.</p>
<p>As stated in the previous section, client does not stop automatically
as long as HTTP/2 session is fine and connection is alive. We don't
call <tt class="docutils literal"><span class="pre">nghttp2::asio_http2::client::session::shutdown</span></tt> in this
example, so the program does not terminate after all responses are
received. Hit Ctrl-C to terminate the program.</p>
</div>
<div class="section" id="multiple-concurrent-requests">
<h3>Multiple concurrent requests<a class="headerlink" href="#multiple-concurrent-requests" title="Permalink to this headline"></a></h3>
<div class="highlight-cpp"><div class="highlight"><pre><span class="cp">#include &lt;iostream&gt;</span>
<span class="cp">#include &lt;nghttp2/asio_http2_client.h&gt;</span>
<span class="k">using</span> <span class="n">boost</span><span class="o">::</span><span class="n">asio</span><span class="o">::</span><span class="n">ip</span><span class="o">::</span><span class="n">tcp</span><span class="p">;</span>
<span class="k">using</span> <span class="k">namespace</span> <span class="n">nghttp2</span><span class="o">::</span><span class="n">asio_http2</span><span class="p">;</span>
<span class="k">using</span> <span class="k">namespace</span> <span class="n">nghttp2</span><span class="o">::</span><span class="n">asio_http2</span><span class="o">::</span><span class="n">client</span><span class="p">;</span>
<span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span> <span class="o">*</span><span class="n">argv</span><span class="p">[])</span> <span class="p">{</span>
<span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_code</span> <span class="n">ec</span><span class="p">;</span>
<span class="n">boost</span><span class="o">::</span><span class="n">asio</span><span class="o">::</span><span class="n">io_service</span> <span class="n">io_service</span><span class="p">;</span>
<span class="c1">// connect to localhost:3000</span>
<span class="n">session</span> <span class="n">sess</span><span class="p">(</span><span class="n">io_service</span><span class="p">,</span> <span class="s">&quot;localhost&quot;</span><span class="p">,</span> <span class="s">&quot;3000&quot;</span><span class="p">);</span>
<span class="n">sess</span><span class="p">.</span><span class="n">on_connect</span><span class="p">([</span><span class="o">&amp;</span><span class="n">sess</span><span class="p">](</span><span class="n">tcp</span><span class="o">::</span><span class="n">resolver</span><span class="o">::</span><span class="n">iterator</span> <span class="n">endpoint_it</span><span class="p">)</span> <span class="p">{</span>
<span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_code</span> <span class="n">ec</span><span class="p">;</span>
<span class="k">auto</span> <span class="n">printer</span> <span class="o">=</span> <span class="p">[](</span><span class="k">const</span> <span class="n">response</span> <span class="o">&amp;</span><span class="n">res</span><span class="p">)</span> <span class="p">{</span>
<span class="n">res</span><span class="p">.</span><span class="n">on_data</span><span class="p">([](</span><span class="k">const</span> <span class="kt">uint8_t</span> <span class="o">*</span><span class="n">data</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="kt">size_t</span> <span class="n">len</span><span class="p">)</span> <span class="p">{</span>
<span class="n">std</span><span class="o">::</span><span class="n">cerr</span><span class="p">.</span><span class="n">write</span><span class="p">(</span><span class="k">reinterpret_cast</span><span class="o">&lt;</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*&gt;</span><span class="p">(</span><span class="n">data</span><span class="p">),</span> <span class="n">len</span><span class="p">);</span>
<span class="n">std</span><span class="o">::</span><span class="n">cerr</span> <span class="o">&lt;&lt;</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
<span class="p">});</span>
<span class="p">};</span>
<span class="n">std</span><span class="o">::</span><span class="kt">size_t</span> <span class="n">num</span> <span class="o">=</span> <span class="mi">3</span><span class="p">;</span>
<span class="k">auto</span> <span class="n">count</span> <span class="o">=</span> <span class="n">std</span><span class="o">::</span><span class="n">make_shared</span><span class="o">&lt;</span><span class="kt">int</span><span class="o">&gt;</span><span class="p">(</span><span class="n">num</span><span class="p">);</span>
<span class="k">for</span> <span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="kt">size_t</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">num</span><span class="p">;</span> <span class="o">++</span><span class="n">i</span><span class="p">)</span> <span class="p">{</span>
<span class="k">auto</span> <span class="n">req</span> <span class="o">=</span> <span class="n">sess</span><span class="p">.</span><span class="n">submit</span><span class="p">(</span><span class="n">ec</span><span class="p">,</span> <span class="s">&quot;GET&quot;</span><span class="p">,</span>
<span class="s">&quot;http://localhost:3000/&quot;</span> <span class="o">+</span> <span class="n">std</span><span class="o">::</span><span class="n">to_string</span><span class="p">(</span><span class="n">i</span> <span class="o">+</span> <span class="mi">1</span><span class="p">));</span>
<span class="n">req</span><span class="o">-&gt;</span><span class="n">on_response</span><span class="p">(</span><span class="n">printer</span><span class="p">);</span>
<span class="n">req</span><span class="o">-&gt;</span><span class="n">on_close</span><span class="p">([</span><span class="o">&amp;</span><span class="n">sess</span><span class="p">,</span> <span class="n">count</span><span class="p">](</span><span class="kt">uint32_t</span> <span class="n">error_code</span><span class="p">)</span> <span class="p">{</span>
<span class="k">if</span> <span class="p">(</span><span class="o">--*</span><span class="n">count</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
<span class="c1">// shutdown session after |num| requests were done.</span>
<span class="n">sess</span><span class="p">.</span><span class="n">shutdown</span><span class="p">();</span>
<span class="p">}</span>
<span class="p">});</span>
<span class="p">}</span>
<span class="p">});</span>
<span class="n">sess</span><span class="p">.</span><span class="n">on_error</span><span class="p">([](</span><span class="k">const</span> <span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_code</span> <span class="o">&amp;</span><span class="n">ec</span><span class="p">)</span> <span class="p">{</span>
<span class="n">std</span><span class="o">::</span><span class="n">cerr</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;error: &quot;</span> <span class="o">&lt;&lt;</span> <span class="n">ec</span><span class="p">.</span><span class="n">message</span><span class="p">()</span> <span class="o">&lt;&lt;</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
<span class="p">});</span>
<span class="n">io_service</span><span class="p">.</span><span class="n">run</span><span class="p">();</span>
<span class="p">}</span>
</pre></div>
</div>
<p>Here is the sample to send 3 requests at once. Depending on the
server settings, these requests are processed out-of-order. In this
example, we have a trick to shutdown session after all requests were
done. We made <tt class="docutils literal"><span class="pre">count</span></tt> object which is shared pointer to int and is
initialized to 3. On each request closure (the invocation of the
callback set by <tt class="docutils literal"><span class="pre">nghttp2::asio_http2::client::request::on_close</span></tt>),
we decrement the count. If count becomes 0, we are sure that all
requests have been done and initiate shutdown.</p>
</div>
</div>
</div>
@ -453,7 +654,7 @@ called.</p>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.7.2-DEV',
VERSION:'0.7.8-DEV',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: false

View File

@ -7,7 +7,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>nghttp(1) &mdash; nghttp2 0.7.2-DEV documentation</title>
<title>nghttp(1) &mdash; nghttp2 0.7.8-DEV documentation</title>
@ -28,7 +28,7 @@
<link rel="top" title="nghttp2 0.7.2-DEV documentation" href="index.html"/>
<link rel="top" title="nghttp2 0.7.8-DEV documentation" href="index.html"/>
<link rel="next" title="nghttpd(1)" href="nghttpd.1.html"/>
<link rel="prev" title="Tutorial: HPACK API" href="tutorial-hpack.html"/>
@ -100,30 +100,33 @@
<li class="toctree-l1 current"><a class="current reference internal" href="">nghttp(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpd.1.html">nghttpd(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpx.1.html">nghttpx(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#files">FILES</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#signals">SIGNALS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#server-push">SERVER PUSH</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#unix-domain-socket">UNIX DOMAIN SOCKET</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load.1.html">h2load(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#output">OUTPUT</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
@ -139,7 +142,7 @@
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#rewriting-location-header-field">Rewriting location header field</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#hot-swapping">Hot swapping</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#re-opening-log-files">Re-opening log files</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-http-1-backend-addresses">Multiple HTTP/1 backend addresses</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-backend-addresses">Multiple backend addresses</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load-howto.html">h2load - HTTP/2 benchmarking tool - HOW-TO</a><ul>
@ -153,6 +156,7 @@
<li class="toctree-l1"><a class="reference internal" href="apiref.html">API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#includes">Includes</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#remarks">Remarks</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#http-messaging">HTTP Messaging</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#macros">Macros</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#enums">Enums</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#types-structs-unions-and-typedefs">Types (structs, unions and typedefs)</a></li>
@ -161,6 +165,7 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="libnghttp2_asio.html">libnghttp2_asio: High level HTTP/2 C++ library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#server-api">Server API</a></li>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#client-api">Client API</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="python-apiref.html">Python API Reference</a><ul>
@ -170,6 +175,8 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2.h.html">nghttp2.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2ver.h.html">nghttp2ver.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_server.h.html">asio_http2_server.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_client.h.html">asio_http2_client.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2.h.html">asio_http2.h</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2">Source</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2/issues">Issues</a></li>
@ -224,7 +231,7 @@
</div>
<div class="section" id="options">
<h2>OPTIONS:<a class="headerlink" href="#options" title="Permalink to this headline"></a></h2>
<h2>OPTIONS<a class="headerlink" href="#options" title="Permalink to this headline"></a></h2>
<dl class="option">
<dt id="cmdoption-v">
<span id="cmdoption--verbose"></span><tt class="descname">-v</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">--verbose</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-v" title="Permalink to this definition"></a></dt>
@ -291,6 +298,15 @@ and images.</p>
<dd><p>Add a header to the requests. Example: <a class="reference internal" href="#cmdoption-H"><em class="xref std std-option">-H</em></a>':method: PUT'</p>
</dd></dl>
<dl class="option">
<dt id="cmdoption--trailer">
<tt class="descname">--trailer</tt><tt class="descclassname">=&lt;HEADER&gt;</tt><a class="headerlink" href="#cmdoption--trailer" title="Permalink to this definition"></a></dt>
<dd><p>Add a trailer header to the requests. &lt;HEADER&gt; must not
include pseudo header field (header field name starting
with ':'). To send trailer, one must use <a class="reference internal" href="nghttpd.1.html#cmdoption-d"><em class="xref std std-option">-d</em></a> option to
send request body. Example: <a class="reference internal" href="nghttpd.1.html#cmdoption--trailer"><em class="xref std std-option">--trailer</em></a> 'foo: bar'.</p>
</dd></dl>
<dl class="option">
<dt id="cmdoption--cert">
<tt class="descname">--cert</tt><tt class="descclassname">=&lt;CERT&gt;</tt><a class="headerlink" href="#cmdoption--cert" title="Permalink to this definition"></a></dt>
@ -453,7 +469,7 @@ is given, data is written to stdout.</p>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.7.2-DEV',
VERSION:'0.7.8-DEV',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: false

View File

@ -7,7 +7,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>nghttp2.h &mdash; nghttp2 0.7.2-DEV documentation</title>
<title>nghttp2.h &mdash; nghttp2 0.7.8-DEV documentation</title>
@ -28,7 +28,7 @@
<link rel="top" title="nghttp2 0.7.2-DEV documentation" href="index.html"/>
<link rel="top" title="nghttp2 0.7.8-DEV documentation" href="index.html"/>
<link rel="next" title="nghttp2ver.h" href="nghttp2ver.h.html"/>
<link rel="prev" title="Python API Reference" href="python-apiref.html"/>
@ -100,30 +100,33 @@
<li class="toctree-l1"><a class="reference internal" href="nghttp.1.html">nghttp(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpd.1.html">nghttpd(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpx.1.html">nghttpx(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#files">FILES</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#signals">SIGNALS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#server-push">SERVER PUSH</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#unix-domain-socket">UNIX DOMAIN SOCKET</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load.1.html">h2load(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#output">OUTPUT</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
@ -139,7 +142,7 @@
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#rewriting-location-header-field">Rewriting location header field</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#hot-swapping">Hot swapping</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#re-opening-log-files">Re-opening log files</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-http-1-backend-addresses">Multiple HTTP/1 backend addresses</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-backend-addresses">Multiple backend addresses</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load-howto.html">h2load - HTTP/2 benchmarking tool - HOW-TO</a><ul>
@ -153,6 +156,7 @@
<li class="toctree-l1"><a class="reference internal" href="apiref.html">API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#includes">Includes</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#remarks">Remarks</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#http-messaging">HTTP Messaging</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#macros">Macros</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#enums">Enums</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#types-structs-unions-and-typedefs">Types (structs, unions and typedefs)</a></li>
@ -161,6 +165,7 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="libnghttp2_asio.html">libnghttp2_asio: High level HTTP/2 C++ library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#server-api">Server API</a></li>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#client-api">Client API</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="python-apiref.html">Python API Reference</a><ul>
@ -170,6 +175,8 @@
</li>
<li class="toctree-l1 current"><a class="current reference internal" href="">nghttp2.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2ver.h.html">nghttp2ver.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_server.h.html">asio_http2_server.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_client.h.html">asio_http2_client.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2.h.html">asio_http2.h</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2">Source</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2/issues">Issues</a></li>
@ -260,6 +267,24 @@
<span class="cm"> */</span>
<span class="cp">#define NGHTTP2_PROTO_VERSION_ID_LEN 5</span>
<span class="cm">/**</span>
<span class="cm"> * @macro</span>
<span class="cm"> *</span>
<span class="cm"> * The seriazlied form of ALPN protocol identifier this library</span>
<span class="cm"> * supports. Notice that first byte is the length of following</span>
<span class="cm"> * protocol identifier. This is the same wire format of `TLS ALPN</span>
<span class="cm"> * extension &lt;https://tools.ietf.org/html/rfc7301&gt;`_. This is useful</span>
<span class="cm"> * to process incoming ALPN tokens in wire format.</span>
<span class="cm"> */</span>
<span class="cp">#define NGHTTP2_PROTO_ALPN &quot;\x5h2-14&quot;</span>
<span class="cm">/**</span>
<span class="cm"> * @macro</span>
<span class="cm"> *</span>
<span class="cm"> * The length of :macro:`NGHTTP2_PROTO_ALPN`.</span>
<span class="cm"> */</span>
<span class="cp">#define NGHTTP2_PROTO_ALPN_LEN (sizeof(NGHTTP2_PROTO_ALPN) - 1)</span>
<span class="cm">/**</span>
<span class="cm"> * @macro</span>
<span class="cm"> *</span>
@ -542,6 +567,11 @@
<span class="cm"> */</span>
<span class="n">NGHTTP2_ERR_SESSION_CLOSING</span> <span class="o">=</span> <span class="o">-</span><span class="mi">530</span><span class="p">,</span>
<span class="cm">/**</span>
<span class="cm"> * Invalid HTTP header field was received and stream is going to be</span>
<span class="cm"> * closed.</span>
<span class="cm"> */</span>
<span class="n">NGHTTP2_ERR_HTTP_HEADER</span> <span class="o">=</span> <span class="o">-</span><span class="mi">531</span><span class="p">,</span>
<span class="cm">/**</span>
<span class="cm"> * The errors &lt; :enum:`NGHTTP2_ERR_FATAL` mean that the library is</span>
<span class="cm"> * under unexpected condition and processing was terminated (e.g.,</span>
<span class="cm"> * out of memory). If application receives this error code, it must</span>
@ -576,7 +606,9 @@
<span class="cm"> */</span>
<span class="n">NGHTTP2_NV_FLAG_NONE</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span>
<span class="cm">/**</span>
<span class="cm"> * Indicates that this name/value pair must not be indexed.</span>
<span class="cm"> * Indicates that this name/value pair must not be indexed (&quot;Literal</span>
<span class="cm"> * Header Field never Indexed&quot; representation must be used in HPACK</span>
<span class="cm"> * encoding). Other implementation calls this bit as &quot;sensitive&quot;.</span>
<span class="cm"> */</span>
<span class="n">NGHTTP2_NV_FLAG_NO_INDEX</span> <span class="o">=</span> <span class="mh">0x01</span>
<span class="p">}</span> <span class="n">nghttp2_nv_flag</span><span class="p">;</span>
@ -654,7 +686,9 @@
<span class="cm"> */</span>
<span class="n">NGHTTP2_WINDOW_UPDATE</span> <span class="o">=</span> <span class="mh">0x08</span><span class="p">,</span>
<span class="cm">/**</span>
<span class="cm"> * The CONTINUATION frame.</span>
<span class="cm"> * The CONTINUATION frame. This frame type won&#39;t be passed to any</span>
<span class="cm"> * callbacks because the library processes this frame type and its</span>
<span class="cm"> * preceding HEADERS/PUSH_PROMISE as a single frame.</span>
<span class="cm"> */</span>
<span class="n">NGHTTP2_CONTINUATION</span> <span class="o">=</span> <span class="mh">0x09</span>
<span class="p">}</span> <span class="n">nghttp2_frame_type</span><span class="p">;</span>
@ -868,7 +902,14 @@
<span class="cm">/**</span>
<span class="cm"> * Indicates EOF was sensed.</span>
<span class="cm"> */</span>
<span class="n">NGHTTP2_DATA_FLAG_EOF</span> <span class="o">=</span> <span class="mh">0x01</span>
<span class="n">NGHTTP2_DATA_FLAG_EOF</span> <span class="o">=</span> <span class="mh">0x01</span><span class="p">,</span>
<span class="cm">/**</span>
<span class="cm"> * Indicates that END_STREAM flag must not be set even if</span>
<span class="cm"> * NGHTTP2_DATA_FLAG_EOF is set. Usually this flag is used to send</span>
<span class="cm"> * trailer header fields with `nghttp2_submit_request()` or</span>
<span class="cm"> * `nghttp2_submit_response()`.</span>
<span class="cm"> */</span>
<span class="n">NGHTTP2_DATA_FLAG_NO_END_STREAM</span> <span class="o">=</span> <span class="mh">0x02</span>
<span class="p">}</span> <span class="n">nghttp2_data_flag</span><span class="p">;</span>
<span class="cm">/**</span>
@ -881,6 +922,21 @@
<span class="cm"> * them in |buf| and return number of data stored in |buf|. If EOF is</span>
<span class="cm"> * reached, set :enum:`NGHTTP2_DATA_FLAG_EOF` flag in |*data_flags|.</span>
<span class="cm"> *</span>
<span class="cm"> * If this callback is set by `nghttp2_submit_request()`,</span>
<span class="cm"> * `nghttp2_submit_response()` or `nghttp2_submit_headers()` and</span>
<span class="cm"> * `nghttp2_submit_data()` with flag parameter</span>
<span class="cm"> * :enum:`NGHTTP2_FLAG_END_STREAM` set, and</span>
<span class="cm"> * :enum:`NGHTTP2_DATA_FLAG_EOF` flag is set to |*data_flags|, DATA</span>
<span class="cm"> * frame will have END_STREAM flag set. Usually, this is expected</span>
<span class="cm"> * behaviour and all are fine. One exception is send trailer header</span>
<span class="cm"> * fields. You cannot send trailers after sending frame with</span>
<span class="cm"> * END_STREAM set. To avoid this problem, one can set</span>
<span class="cm"> * :enum:`NGHTTP2_DATA_FLAG_NO_END_STREAM` along with</span>
<span class="cm"> * :enum:`NGHTTP2_DATA_FLAG_EOF` to signal the library not to set</span>
<span class="cm"> * END_STREAM in DATA frame. Then application can use</span>
<span class="cm"> * `nghttp2_submit_trailer()` to send trailers.</span>
<span class="cm"> * `nghttp2_submit_trailer()` can be called inside this callback.</span>
<span class="cm"> *</span>
<span class="cm"> * If the application wants to postpone DATA frames (e.g.,</span>
<span class="cm"> * asynchronous I/O, or reading data blocks for long time), it is</span>
<span class="cm"> * achieved by returning :enum:`NGHTTP2_ERR_DEFERRED` without reading</span>
@ -1515,6 +1571,9 @@
<span class="cm"> * `nghttp2_session_recv()` and `nghttp2_session_send()` functions</span>
<span class="cm"> * immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`.</span>
<span class="cm"> *</span>
<span class="cm"> * `nghttp2_session_get_stream_user_data()` can be used to get</span>
<span class="cm"> * associated data.</span>
<span class="cm"> *</span>
<span class="cm"> * To set this callback to :type:`nghttp2_session_callbacks`, use</span>
<span class="cm"> * `nghttp2_session_callbacks_set_on_frame_not_send_callback()`.</span>
<span class="cm"> */</span>
@ -1563,6 +1622,27 @@
<span class="cm"> * not need to care about that because the header name/value pairs are</span>
<span class="cm"> * emitted transparently regardless of CONTINUATION frames.</span>
<span class="cm"> *</span>
<span class="cm"> * The server applications probably create an object to store</span>
<span class="cm"> * information about new stream if ``frame-&gt;hd.type ==</span>
<span class="cm"> * NGHTTP2_HEADERS`` and ``frame-&gt;headers.cat ==</span>
<span class="cm"> * NGHTTP2_HCAT_REQUEST``. If |session| is configured as server side,</span>
<span class="cm"> * ``frame-&gt;headers.cat`` is either ``NGHTTP2_HCAT_REQUEST``</span>
<span class="cm"> * containing request headers or ``NGHTTP2_HCAT_HEADERS`` containing</span>
<span class="cm"> * trailer headers and never get PUSH_PROMISE in this callback.</span>
<span class="cm"> *</span>
<span class="cm"> * For the client applications, ``frame-&gt;hd.type`` is either</span>
<span class="cm"> * ``NGHTTP2_HEADERS`` or ``NGHTTP2_PUSH_PROMISE``. In case of</span>
<span class="cm"> * ``NGHTTP2_HEADERS``, ``frame-&gt;headers.cat ==</span>
<span class="cm"> * NGHTTP2_HCAT_RESPONSE`` means that it is the first response</span>
<span class="cm"> * headers, but it may be non-final response which is indicated by 1xx</span>
<span class="cm"> * status code. In this case, there may be zero or more HEADERS frame</span>
<span class="cm"> * with ``frame-&gt;headers.cat == NGHTTP2_HCAT_HEADERS`` which has</span>
<span class="cm"> * non-final response code and finally client gets exactly one HEADERS</span>
<span class="cm"> * frame with ``frame-&gt;headers.cat == NGHTTP2_HCAT_HEADERS``</span>
<span class="cm"> * containing final response headers (non-1xx status code). The</span>
<span class="cm"> * trailer headers also has ``frame-&gt;headers.cat ==</span>
<span class="cm"> * NGHTTP2_HCAT_HEADERS`` which does not containg any status code.</span>
<span class="cm"> *</span>
<span class="cm"> * The implementation of this function must return 0 if it succeeds or</span>
<span class="cm"> * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. If nonzero value other than</span>
<span class="cm"> * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE` is returned, it is treated as</span>
@ -1588,7 +1668,8 @@
<span class="cm"> *</span>
<span class="cm"> * If :enum:`NGHTTP2_NV_FLAG_NO_INDEX` is set in |flags|, the receiver</span>
<span class="cm"> * must not index this name/value pair when forwarding it to the next</span>
<span class="cm"> * hop.</span>
<span class="cm"> * hop. More specifically, &quot;Literal Header Field never Indexed&quot;</span>
<span class="cm"> * representation must be used in HPACK encoding.</span>
<span class="cm"> *</span>
<span class="cm"> * When this callback is invoked, ``frame-&gt;hd.type`` is either</span>
<span class="cm"> * :enum:`NGHTTP2_HEADERS` or :enum:`NGHTTP2_PUSH_PROMISE`. After all</span>
@ -1598,21 +1679,14 @@
<span class="cm"> * :type:`nghttp2_on_frame_recv_callback` for the |frame| will not be</span>
<span class="cm"> * invoked.</span>
<span class="cm"> *</span>
<span class="cm"> * The |name| may be ``NULL`` if the |namelen| is 0. The same thing</span>
<span class="cm"> * can be said about the |value|.</span>
<span class="cm"> * The |value| may be ``NULL`` if the |valuelen| is 0.</span>
<span class="cm"> *</span>
<span class="cm"> * Please note that nghttp2 library does not perform any validity</span>
<span class="cm"> * check against the |name| and the |value|. For example, the</span>
<span class="cm"> * |namelen| could be 0, and/or the |value| contains ``0x0a`` or</span>
<span class="cm"> * ``0x0d``. The application must check them if it matters. The</span>
<span class="cm"> * helper function `nghttp2_check_header_name()` and</span>
<span class="cm"> * `nghttp2_check_header_value()` provide simple validation against</span>
<span class="cm"> * HTTP2 header field construction rule.</span>
<span class="cm"> *</span>
<span class="cm"> * HTTP/2 specification requires that pseudo header fields (header</span>
<span class="cm"> * field starting with &#39;:&#39;) must appear in front of regular header</span>
<span class="cm"> * fields. The library does not validate this requirement. The</span>
<span class="cm"> * application must check them if it matters.</span>
<span class="cm"> * Please note that unless `nghttp2_option_set_no_http_messaging()` is</span>
<span class="cm"> * used, nghttp2 library does perform validation against the |name|</span>
<span class="cm"> * and the |value| using `nghttp2_check_header_name()` and</span>
<span class="cm"> * `nghttp2_check_header_value()`. In addition to this, nghttp2</span>
<span class="cm"> * performs vaidation based on HTTP Messaging rule, which is briefly</span>
<span class="cm"> * explained in `HTTP Messaging`_ section.</span>
<span class="cm"> *</span>
<span class="cm"> * If the application uses `nghttp2_session_mem_recv()`, it can return</span>
<span class="cm"> * :enum:`NGHTTP2_ERR_PAUSE` to make `nghttp2_session_mem_recv()`</span>
@ -2080,6 +2154,18 @@
<span class="cm"> */</span>
<span class="kt">void</span> <span class="nf">nghttp2_option_set_recv_client_preface</span><span class="p">(</span><span class="n">nghttp2_option</span> <span class="o">*</span><span class="n">option</span><span class="p">,</span> <span class="kt">int</span> <span class="n">val</span><span class="p">);</span>
<span class="cm">/**</span>
<span class="cm"> * @function</span>
<span class="cm"> *</span>
<span class="cm"> * By default, nghttp2 library enforces subset of HTTP Messaging rules</span>
<span class="cm"> * described in `HTTP/2 specification, section 8</span>
<span class="cm"> * &lt;https://tools.ietf.org/html/draft-ietf-httpbis-http2-17#section-8&gt;`_.</span>
<span class="cm"> * See `HTTP Messaging`_ section for details. For those applications</span>
<span class="cm"> * who use nghttp2 library as non-HTTP use, give nonzero to |val| to</span>
<span class="cm"> * disable this enforcement.</span>
<span class="cm"> */</span>
<span class="kt">void</span> <span class="nf">nghttp2_option_set_no_http_messaging</span><span class="p">(</span><span class="n">nghttp2_option</span> <span class="o">*</span><span class="n">option</span><span class="p">,</span> <span class="kt">int</span> <span class="n">val</span><span class="p">);</span>
<span class="cm">/**</span>
<span class="cm"> * @function</span>
<span class="cm"> *</span>
@ -2990,6 +3076,53 @@
<span class="k">const</span> <span class="n">nghttp2_nv</span> <span class="o">*</span><span class="n">nva</span><span class="p">,</span> <span class="kt">size_t</span> <span class="n">nvlen</span><span class="p">,</span>
<span class="k">const</span> <span class="n">nghttp2_data_provider</span> <span class="o">*</span><span class="n">data_prd</span><span class="p">);</span>
<span class="cm">/**</span>
<span class="cm"> * @function</span>
<span class="cm"> *</span>
<span class="cm"> * Submits trailer HEADERS against the stream |stream_id|.</span>
<span class="cm"> *</span>
<span class="cm"> * The |nva| is an array of name/value pair :type:`nghttp2_nv` with</span>
<span class="cm"> * |nvlen| elements. The application is responsible not to include</span>
<span class="cm"> * required pseudo-header fields (header field whose name starts with</span>
<span class="cm"> * &quot;:&quot;) in |nva|.</span>
<span class="cm"> *</span>
<span class="cm"> * This function creates copies of all name/value pairs in |nva|. It</span>
<span class="cm"> * also lower-cases all names in |nva|. The order of elements in</span>
<span class="cm"> * |nva| is preserved.</span>
<span class="cm"> *</span>
<span class="cm"> * For server, trailer must be followed by response HEADERS or</span>
<span class="cm"> * response DATA. The library does not check that response HEADERS</span>
<span class="cm"> * has already sent and if `nghttp2_submit_trailer()` is called before</span>
<span class="cm"> * any response HEADERS submission (usually by</span>
<span class="cm"> * `nghttp2_submit_response()`), the content of |nva| will be sent as</span>
<span class="cm"> * reponse headers, which will result in error.</span>
<span class="cm"> *</span>
<span class="cm"> * This function has the same effect with `nghttp2_submit_headers()`,</span>
<span class="cm"> * with flags = :enum:`NGHTTP2_FLAG_END_HEADERS` and both pri_spec and</span>
<span class="cm"> * stream_user_data to NULL.</span>
<span class="cm"> *</span>
<span class="cm"> * To submit trailer after `nghttp2_submit_response()` is called, the</span>
<span class="cm"> * application has to specify :type:`nghttp2_data_provider` to</span>
<span class="cm"> * `nghttp2_submit_response()`. In side</span>
<span class="cm"> * :type:`nghttp2_data_source_read_callback`, when setting</span>
<span class="cm"> * :enum:`NGHTTP2_DATA_FLAG_EOF`, also set</span>
<span class="cm"> * :enum:`NGHTTP2_DATA_FLAG_NO_END_STREAM`. After that, the</span>
<span class="cm"> * application can send trailer using `nghttp2_submit_trailer()`.</span>
<span class="cm"> * `nghttp2_submit_trailer()` can be used inside</span>
<span class="cm"> * :type:`nghttp2_data_source_read_callback`.</span>
<span class="cm"> *</span>
<span class="cm"> * This function returns 0 if it succeeds and |stream_id| is -1.</span>
<span class="cm"> * Otherwise, this function returns 0 if it succeeds, or one of the</span>
<span class="cm"> * following negative error codes:</span>
<span class="cm"> *</span>
<span class="cm"> * :enum:`NGHTTP2_ERR_NOMEM`</span>
<span class="cm"> * Out of memory.</span>
<span class="cm"> * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT`</span>
<span class="cm"> * The |stream_id| is 0.</span>
<span class="cm"> */</span>
<span class="kt">int</span> <span class="nf">nghttp2_submit_trailer</span><span class="p">(</span><span class="n">nghttp2_session</span> <span class="o">*</span><span class="n">session</span><span class="p">,</span> <span class="kt">int32_t</span> <span class="n">stream_id</span><span class="p">,</span>
<span class="k">const</span> <span class="n">nghttp2_nv</span> <span class="o">*</span><span class="n">nva</span><span class="p">,</span> <span class="kt">size_t</span> <span class="n">nvlen</span><span class="p">);</span>
<span class="cm">/**</span>
<span class="cm"> * @function</span>
<span class="cm"> *</span>
@ -3227,6 +3360,9 @@
<span class="cm"> *</span>
<span class="cm"> * The client side is not allowed to use this function.</span>
<span class="cm"> *</span>
<span class="cm"> * To submit response headers and data, use</span>
<span class="cm"> * `nghttp2_submit_response()`.</span>
<span class="cm"> *</span>
<span class="cm"> * This function returns assigned promised stream ID if it succeeds,</span>
<span class="cm"> * or one of the following negative error codes:</span>
<span class="cm"> *</span>
@ -3849,7 +3985,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.7.2-DEV',
VERSION:'0.7.8-DEV',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: false

View File

@ -7,7 +7,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>nghttp2ver.h &mdash; nghttp2 0.7.2-DEV documentation</title>
<title>nghttp2ver.h &mdash; nghttp2 0.7.8-DEV documentation</title>
@ -28,8 +28,8 @@
<link rel="top" title="nghttp2 0.7.2-DEV documentation" href="index.html"/>
<link rel="next" title="asio_http2.h" href="asio_http2.h.html"/>
<link rel="top" title="nghttp2 0.7.8-DEV documentation" href="index.html"/>
<link rel="next" title="asio_http2_server.h" href="asio_http2_server.h.html"/>
<link rel="prev" title="nghttp2.h" href="nghttp2.h.html"/>
@ -100,30 +100,33 @@
<li class="toctree-l1"><a class="reference internal" href="nghttp.1.html">nghttp(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpd.1.html">nghttpd(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpx.1.html">nghttpx(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#files">FILES</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#signals">SIGNALS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#server-push">SERVER PUSH</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#unix-domain-socket">UNIX DOMAIN SOCKET</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load.1.html">h2load(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#output">OUTPUT</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
@ -139,7 +142,7 @@
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#rewriting-location-header-field">Rewriting location header field</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#hot-swapping">Hot swapping</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#re-opening-log-files">Re-opening log files</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-http-1-backend-addresses">Multiple HTTP/1 backend addresses</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-backend-addresses">Multiple backend addresses</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load-howto.html">h2load - HTTP/2 benchmarking tool - HOW-TO</a><ul>
@ -153,6 +156,7 @@
<li class="toctree-l1"><a class="reference internal" href="apiref.html">API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#includes">Includes</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#remarks">Remarks</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#http-messaging">HTTP Messaging</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#macros">Macros</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#enums">Enums</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#types-structs-unions-and-typedefs">Types (structs, unions and typedefs)</a></li>
@ -161,6 +165,7 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="libnghttp2_asio.html">libnghttp2_asio: High level HTTP/2 C++ library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#server-api">Server API</a></li>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#client-api">Client API</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="python-apiref.html">Python API Reference</a><ul>
@ -170,6 +175,8 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2.h.html">nghttp2.h</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="">nghttp2ver.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_server.h.html">asio_http2_server.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_client.h.html">asio_http2_client.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2.h.html">asio_http2.h</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2">Source</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2/issues">Issues</a></li>
@ -240,7 +247,7 @@
<span class="cm"> * @macro</span>
<span class="cm"> * Version number of the nghttp2 library release</span>
<span class="cm"> */</span>
<span class="cp">#define NGHTTP2_VERSION &quot;0.7.2-DEV&quot;</span>
<span class="cp">#define NGHTTP2_VERSION &quot;0.7.8-DEV&quot;</span>
<span class="cm">/**</span>
<span class="cm"> * @macro</span>
@ -248,7 +255,7 @@
<span class="cm"> * release. This is a 24 bit number with 8 bits for major number, 8 bits</span>
<span class="cm"> * for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203.</span>
<span class="cm"> */</span>
<span class="cp">#define NGHTTP2_VERSION_NUM 0x000702</span>
<span class="cp">#define NGHTTP2_VERSION_NUM 0x000708</span>
<span class="cp">#endif </span><span class="cm">/* NGHTTP2VER_H */</span><span class="cp"></span>
</pre></div>
@ -261,7 +268,7 @@
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="asio_http2.h.html" class="btn btn-neutral float-right" title="asio_http2.h">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="asio_http2_server.h.html" class="btn btn-neutral float-right" title="asio_http2_server.h">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="nghttp2.h.html" class="btn btn-neutral" title="nghttp2.h"><span class="fa fa-arrow-circle-left"></span> Previous</a>
@ -294,7 +301,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.7.2-DEV',
VERSION:'0.7.8-DEV',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: false

View File

@ -7,7 +7,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>nghttpd(1) &mdash; nghttp2 0.7.2-DEV documentation</title>
<title>nghttpd(1) &mdash; nghttp2 0.7.8-DEV documentation</title>
@ -28,7 +28,7 @@
<link rel="top" title="nghttp2 0.7.2-DEV documentation" href="index.html"/>
<link rel="top" title="nghttp2 0.7.8-DEV documentation" href="index.html"/>
<link rel="next" title="nghttpx(1)" href="nghttpx.1.html"/>
<link rel="prev" title="nghttp(1)" href="nghttp.1.html"/>
@ -100,30 +100,33 @@
<li class="toctree-l1"><a class="reference internal" href="nghttp.1.html">nghttp(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1 current"><a class="current reference internal" href="">nghttpd(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpx.1.html">nghttpx(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#files">FILES</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#signals">SIGNALS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#server-push">SERVER PUSH</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#unix-domain-socket">UNIX DOMAIN SOCKET</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load.1.html">h2load(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#output">OUTPUT</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
@ -139,7 +142,7 @@
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#rewriting-location-header-field">Rewriting location header field</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#hot-swapping">Hot swapping</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#re-opening-log-files">Re-opening log files</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-http-1-backend-addresses">Multiple HTTP/1 backend addresses</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-backend-addresses">Multiple backend addresses</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load-howto.html">h2load - HTTP/2 benchmarking tool - HOW-TO</a><ul>
@ -153,6 +156,7 @@
<li class="toctree-l1"><a class="reference internal" href="apiref.html">API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#includes">Includes</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#remarks">Remarks</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#http-messaging">HTTP Messaging</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#macros">Macros</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#enums">Enums</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#types-structs-unions-and-typedefs">Types (structs, unions and typedefs)</a></li>
@ -161,6 +165,7 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="libnghttp2_asio.html">libnghttp2_asio: High level HTTP/2 C++ library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#server-api">Server API</a></li>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#client-api">Client API</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="python-apiref.html">Python API Reference</a><ul>
@ -170,6 +175,8 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2.h.html">nghttp2.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2ver.h.html">nghttp2ver.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_server.h.html">asio_http2_server.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_client.h.html">asio_http2_client.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2.h.html">asio_http2.h</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2">Source</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2/issues">Issues</a></li>
@ -238,7 +245,14 @@
</div>
<div class="section" id="options">
<h2>OPTIONS:<a class="headerlink" href="#options" title="Permalink to this headline"></a></h2>
<h2>OPTIONS<a class="headerlink" href="#options" title="Permalink to this headline"></a></h2>
<dl class="option">
<dt id="cmdoption-a">
<span id="cmdoption--address"></span><tt class="descname">-a</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">--address</tt><tt class="descclassname">=&lt;ADDR&gt;</tt><a class="headerlink" href="#cmdoption-a" title="Permalink to this definition"></a></dt>
<dd><p>The address to bind to. If not specified the default IP
address determined by getaddrinfo is used.</p>
</dd></dl>
<dl class="option">
<dt id="cmdoption-D">
<span id="cmdoption--daemon"></span><tt class="descname">-D</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">--daemon</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-D" title="Permalink to this definition"></a></dt>
@ -333,6 +347,15 @@ available.</p>
rather than complete request is received.</p>
</dd></dl>
<dl class="option">
<dt id="cmdoption--trailer">
<tt class="descname">--trailer</tt><tt class="descclassname">=&lt;HEADER&gt;</tt><a class="headerlink" href="#cmdoption--trailer" title="Permalink to this definition"></a></dt>
<dd><p>Add a trailer header to a response. &lt;HEADER&gt; must not
include pseudo header field (header field name starting
with ':'). The trailer is sent only if a response has
body part. Example: <a class="reference internal" href="#cmdoption--trailer"><em class="xref std std-option">--trailer</em></a> 'foo: bar'.</p>
</dd></dl>
<dl class="option">
<dt id="cmdoption--version">
<tt class="descname">--version</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption--version" title="Permalink to this definition"></a></dt>
@ -393,7 +416,7 @@ rather than complete request is received.</p>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.7.2-DEV',
VERSION:'0.7.8-DEV',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: false

View File

@ -7,7 +7,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>nghttpx - HTTP/2 proxy - HOW-TO &mdash; nghttp2 0.7.2-DEV documentation</title>
<title>nghttpx - HTTP/2 proxy - HOW-TO &mdash; nghttp2 0.7.8-DEV documentation</title>
@ -28,7 +28,7 @@
<link rel="top" title="nghttp2 0.7.2-DEV documentation" href="index.html"/>
<link rel="top" title="nghttp2 0.7.8-DEV documentation" href="index.html"/>
<link rel="next" title="h2load - HTTP/2 benchmarking tool - HOW-TO" href="h2load-howto.html"/>
<link rel="prev" title="h2load(1)" href="h2load.1.html"/>
@ -100,30 +100,33 @@
<li class="toctree-l1"><a class="reference internal" href="nghttp.1.html">nghttp(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpd.1.html">nghttpd(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpx.1.html">nghttpx(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#files">FILES</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#signals">SIGNALS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#server-push">SERVER PUSH</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#unix-domain-socket">UNIX DOMAIN SOCKET</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load.1.html">h2load(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#output">OUTPUT</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
@ -139,7 +142,7 @@
<li class="toctree-l2"><a class="reference internal" href="#rewriting-location-header-field">Rewriting location header field</a></li>
<li class="toctree-l2"><a class="reference internal" href="#hot-swapping">Hot swapping</a></li>
<li class="toctree-l2"><a class="reference internal" href="#re-opening-log-files">Re-opening log files</a></li>
<li class="toctree-l2"><a class="reference internal" href="#multiple-http-1-backend-addresses">Multiple HTTP/1 backend addresses</a></li>
<li class="toctree-l2"><a class="reference internal" href="#multiple-backend-addresses">Multiple backend addresses</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load-howto.html">h2load - HTTP/2 benchmarking tool - HOW-TO</a><ul>
@ -153,6 +156,7 @@
<li class="toctree-l1"><a class="reference internal" href="apiref.html">API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#includes">Includes</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#remarks">Remarks</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#http-messaging">HTTP Messaging</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#macros">Macros</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#enums">Enums</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#types-structs-unions-and-typedefs">Types (structs, unions and typedefs)</a></li>
@ -161,6 +165,7 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="libnghttp2_asio.html">libnghttp2_asio: High level HTTP/2 C++ library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#server-api">Server API</a></li>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#client-api">Client API</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="python-apiref.html">Python API Reference</a><ul>
@ -170,6 +175,8 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2.h.html">nghttp2.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2ver.h.html">nghttp2ver.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_server.h.html">asio_http2_server.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_client.h.html">asio_http2_client.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2.h.html">asio_http2.h</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2">Source</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2/issues">Issues</a></li>
@ -259,11 +266,11 @@ called secure proxy. If nghttpx is linked with spdylay, it supports
SPDY protocols and it works as so called SPDY proxy.</p>
<p>With <tt class="docutils literal"><span class="pre">--frontend-no-tls</span></tt> option, SSL/TLS is turned off in frontend
connection, so the connection gets insecure.</p>
<p>The backend must be HTTP/1 proxy server. nghttpx only supports
multiple backend server addresses. It translates incoming requests to
HTTP/1 request to backend server. The backend server performs real
proxy work for each request, for example, dispatching requests to the
origin server and caching contents.</p>
<p>The backend must be HTTP/1 proxy server. nghttpx supports multiple
backend server addresses. It translates incoming requests to HTTP/1
request to backend server. The backend server performs real proxy
work for each request, for example, dispatching requests to the origin
server and caching contents.</p>
<p>For example, to make nghttpx listen to encrypted HTTP/2 requests at
port 8443, and a backend HTTP/1 proxy server is configured to listen
to HTTP/1 request at port 8080 in the same host, run nghttpx
@ -315,7 +322,9 @@ the backend. User cannot enable SSL/TLS in frontend connection.</p>
<p>HTTP/1 frontend connection can be upgraded to HTTP/2 using HTTP
Upgrade. To disable SSL/TLS in backend connection, use
<tt class="docutils literal"><span class="pre">--backend-no-tls</span></tt> option.</p>
<p>The backend connection is created one per worker (thread).</p>
<p>By default, the number of backend HTTP/2 connections per worker
(thread) is determined by number of <tt class="docutils literal"><span class="pre">-b</span></tt> option. To adjust this
value, use <tt class="docutils literal"><span class="pre">--backend-http2-connections-per-worker</span></tt> option.</p>
<p>The backend server is supporsed to be a HTTP/2 web server (e.g.,
nghttpd). The one use-case of this mode is utilize existing HTTP/1
clients to test HTTP/2 deployment. Suppose that HTTP/2 web server
@ -344,7 +353,9 @@ line.</p>
<p>HTTP/1 frontend connection can be upgraded to HTTP/2 using HTTP
Upgrade. To disable SSL/TLS in backend connection, use
<tt class="docutils literal"><span class="pre">--backend-no-tls</span></tt> option.</p>
<p>The backend connection is created one per worker (thread).</p>
<p>By default, the number of backend HTTP/2 connections per worker
(thread) is determined by number of <tt class="docutils literal"><span class="pre">-b</span></tt> option. To adjust this
value, use <tt class="docutils literal"><span class="pre">--backend-http2-connections-per-worker</span></tt> option.</p>
<p>The backend server must be a HTTP/2 proxy. You can use nghttpx in
<a class="reference internal" href="#http-2-proxy-mode">HTTP/2 proxy mode</a> as backend server. The one use-case of this mode
is utilize existing HTTP/1 clients to test HTTP/2 connections between
@ -379,10 +390,13 @@ only.</p>
<p>With <tt class="docutils literal"><span class="pre">--frontend-no-tls</span></tt> option, SSL/TLS is turned off in frontend
connection, so the connection gets insecure. To disable SSL/TLS in
backend connection, use <tt class="docutils literal"><span class="pre">--backend-no-tls</span></tt> option.</p>
<p>By default, the number of backend HTTP/2 connections per worker
(thread) is determined by number of <tt class="docutils literal"><span class="pre">-b</span></tt> option. To adjust this
value, use <tt class="docutils literal"><span class="pre">--backend-http2-connections-per-worker</span></tt> option.</p>
<p>The backend server is supporsed to be a HTTP/2 web server or HTTP/2
proxy. If backend server is HTTP/2 proxy, use
<tt class="docutils literal"><span class="pre">--no-location-rewrite</span></tt> option to disable rewriting location header
field.</p>
<tt class="docutils literal"><span class="pre">--no-location-rewrite</span></tt> and <tt class="docutils literal"><span class="pre">--no-host-rewrite</span></tt> options to disable
rewriting location, host and :authority header field.</p>
<p>The use-case of this mode is aggregate the incoming connections to one
HTTP/2 connection. One backend HTTP/2 connection is created per
worker (thread).</p>
@ -457,13 +471,13 @@ re-open log files, send USR1 signal to nghttpx process. It will
re-open files specified by <tt class="docutils literal"><span class="pre">--accesslog-file</span></tt> and
<tt class="docutils literal"><span class="pre">--errorlog-file</span></tt> options.</p>
</div>
<div class="section" id="multiple-http-1-backend-addresses">
<h2>Multiple HTTP/1 backend addresses<a class="headerlink" href="#multiple-http-1-backend-addresses" title="Permalink to this headline"></a></h2>
<p>nghttpx supports multiple HTTP/1 backend addresses. To specify them,
just use <tt class="docutils literal"><span class="pre">-b</span></tt> option repeatedly. For example, to use backend1:8080
and backend2:8080, use command-line like this: <tt class="docutils literal"><span class="pre">-bbackend1,8080</span>
<span class="pre">-bbackend2,8080</span></tt>. Please note that HTTP/2 backend only supports 1
backend address.</p>
<div class="section" id="multiple-backend-addresses">
<h2>Multiple backend addresses<a class="headerlink" href="#multiple-backend-addresses" title="Permalink to this headline"></a></h2>
<p>nghttpx supports multiple backend addresses. To specify them, just
use <tt class="docutils literal"><span class="pre">-b</span></tt> option repeatedly. For example, to use backend1:8080 and
backend2:8080, use command-line like this: <tt class="docutils literal"><span class="pre">-bbackend1,8080</span>
<span class="pre">-bbackend2,8080</span></tt>. For HTTP/2 backend, see also
<tt class="docutils literal"><span class="pre">--backend-http2-connections-per-worker</span></tt> option.</p>
</div>
</div>
@ -506,7 +520,7 @@ backend address.</p>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.7.2-DEV',
VERSION:'0.7.8-DEV',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: false

View File

@ -7,7 +7,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>nghttpx(1) &mdash; nghttp2 0.7.2-DEV documentation</title>
<title>nghttpx(1) &mdash; nghttp2 0.7.8-DEV documentation</title>
@ -28,7 +28,7 @@
<link rel="top" title="nghttp2 0.7.2-DEV documentation" href="index.html"/>
<link rel="top" title="nghttp2 0.7.8-DEV documentation" href="index.html"/>
<link rel="next" title="h2load(1)" href="h2load.1.html"/>
<link rel="prev" title="nghttpd(1)" href="nghttpd.1.html"/>
@ -100,30 +100,33 @@
<li class="toctree-l1"><a class="reference internal" href="nghttp.1.html">nghttp(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpd.1.html">nghttpd(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1 current"><a class="current reference internal" href="">nghttpx(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="#files">FILES</a></li>
<li class="toctree-l2"><a class="reference internal" href="#signals">SIGNALS</a></li>
<li class="toctree-l2"><a class="reference internal" href="#server-push">SERVER PUSH</a></li>
<li class="toctree-l2"><a class="reference internal" href="#unix-domain-socket">UNIX DOMAIN SOCKET</a></li>
<li class="toctree-l2"><a class="reference internal" href="#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load.1.html">h2load(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#output">OUTPUT</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
@ -139,7 +142,7 @@
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#rewriting-location-header-field">Rewriting location header field</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#hot-swapping">Hot swapping</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#re-opening-log-files">Re-opening log files</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-http-1-backend-addresses">Multiple HTTP/1 backend addresses</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-backend-addresses">Multiple backend addresses</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load-howto.html">h2load - HTTP/2 benchmarking tool - HOW-TO</a><ul>
@ -153,6 +156,7 @@
<li class="toctree-l1"><a class="reference internal" href="apiref.html">API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#includes">Includes</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#remarks">Remarks</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#http-messaging">HTTP Messaging</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#macros">Macros</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#enums">Enums</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#types-structs-unions-and-typedefs">Types (structs, unions and typedefs)</a></li>
@ -161,6 +165,7 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="libnghttp2_asio.html">libnghttp2_asio: High level HTTP/2 C++ library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#server-api">Server API</a></li>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#client-api">Client API</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="python-apiref.html">Python API Reference</a><ul>
@ -170,6 +175,8 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2.h.html">nghttp2.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2ver.h.html">nghttp2ver.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_server.h.html">asio_http2_server.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_client.h.html">asio_http2_client.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2.h.html">asio_http2.h</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2">Source</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2/issues">Issues</a></li>
@ -232,18 +239,17 @@
</div>
<div class="section" id="options">
<h2>OPTIONS:<a class="headerlink" href="#options" title="Permalink to this headline"></a></h2>
<h2>OPTIONS<a class="headerlink" href="#options" title="Permalink to this headline"></a></h2>
<p>The options are categorized into several groups.</p>
<div class="section" id="connections">
<h3>Connections:<a class="headerlink" href="#connections" title="Permalink to this headline"></a></h3>
<h3>Connections<a class="headerlink" href="#connections" title="Permalink to this headline"></a></h3>
<dl class="option">
<dt id="cmdoption-b">
<span id="cmdoption--backend"></span><tt class="descname">-b</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">--backend</tt><tt class="descclassname">=&lt;HOST,PORT&gt;</tt><a class="headerlink" href="#cmdoption-b" title="Permalink to this definition"></a></dt>
<dd><p>Set backend host and port. For HTTP/1 backend, multiple
backend addresses are accepted by repeating this option.
HTTP/2 backend does not support multiple backend
addresses and the first occurrence of this option is
used.</p>
<dd><p>Set backend host and port. The multiple backend
addresses are accepted by repeating this option. UNIX
domain socket can be specified by prefixing path name
with &quot;unix:&quot; (e.g., unix:/var/run/backend.sock)</p>
<p>Default: <tt class="docutils literal"><span class="pre">127.0.0.1,80</span></tt></p>
</dd></dl>
@ -251,7 +257,9 @@ used.</p>
<dt id="cmdoption-f">
<span id="cmdoption--frontend"></span><tt class="descname">-f</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">--frontend</tt><tt class="descclassname">=&lt;HOST,PORT&gt;</tt><a class="headerlink" href="#cmdoption-f" title="Permalink to this definition"></a></dt>
<dd><p>Set frontend host and port. If &lt;HOST&gt; is '*', it
assumes all addresses including both IPv4 and IPv6.</p>
assumes all addresses including both IPv4 and IPv6.
UNIX domain socket can be specified by prefixing path
name with &quot;unix:&quot; (e.g., unix:/var/run/nghttpx.sock)</p>
<p>Default: <tt class="docutils literal"><span class="pre">*,3000</span></tt></p>
</dd></dl>
@ -293,7 +301,7 @@ be specified by <a class="reference internal" href="#cmdoption--backe
</div>
<div class="section" id="performance">
<h3>Performance:<a class="headerlink" href="#performance" title="Permalink to this headline"></a></h3>
<h3>Performance<a class="headerlink" href="#performance" title="Permalink to this headline"></a></h3>
<dl class="option">
<dt id="cmdoption-n">
<span id="cmdoption--workers"></span><tt class="descname">-n</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">--workers</tt><tt class="descclassname">=&lt;N&gt;</tt><a class="headerlink" href="#cmdoption-n" title="Permalink to this definition"></a></dt>
@ -379,6 +387,14 @@ accepts. Setting 0 means unlimited.</p>
<p>Default: <tt class="docutils literal"><span class="pre">0</span></tt></p>
</dd></dl>
<dl class="option">
<dt id="cmdoption--backend-http2-connections-per-worker">
<tt class="descname">--backend-http2-connections-per-worker</tt><tt class="descclassname">=&lt;N&gt;</tt><a class="headerlink" href="#cmdoption--backend-http2-connections-per-worker" title="Permalink to this definition"></a></dt>
<dd><p>Set maximum number of HTTP/2 connections per worker.
The default value is 0, which means the number of
backend addresses specified by <a class="reference internal" href="#cmdoption-b"><em class="xref std std-option">-b</em></a> option.</p>
</dd></dl>
<dl class="option">
<dt id="cmdoption--backend-http1-connections-per-host">
<tt class="descname">--backend-http1-connections-per-host</tt><tt class="descclassname">=&lt;N&gt;</tt><a class="headerlink" href="#cmdoption--backend-http1-connections-per-host" title="Permalink to this definition"></a></dt>
@ -420,37 +436,37 @@ If 0 is given, nghttpx does not set the limit.</p>
<dt id="cmdoption--backend-response-buffer">
<tt class="descname">--backend-response-buffer</tt><tt class="descclassname">=&lt;SIZE&gt;</tt><a class="headerlink" href="#cmdoption--backend-response-buffer" title="Permalink to this definition"></a></dt>
<dd><p>Set buffer size used to store backend response.</p>
<p>Default: <tt class="docutils literal"><span class="pre">64K</span></tt></p>
<p>Default: <tt class="docutils literal"><span class="pre">16K</span></tt></p>
</dd></dl>
</div>
<div class="section" id="timeout">
<h3>Timeout:<a class="headerlink" href="#timeout" title="Permalink to this headline"></a></h3>
<h3>Timeout<a class="headerlink" href="#timeout" title="Permalink to this headline"></a></h3>
<dl class="option">
<dt id="cmdoption--frontend-http2-read-timeout">
<tt class="descname">--frontend-http2-read-timeout</tt><tt class="descclassname">=&lt;SEC&gt;</tt><a class="headerlink" href="#cmdoption--frontend-http2-read-timeout" title="Permalink to this definition"></a></dt>
<tt class="descname">--frontend-http2-read-timeout</tt><tt class="descclassname">=&lt;DURATION&gt;</tt><a class="headerlink" href="#cmdoption--frontend-http2-read-timeout" title="Permalink to this definition"></a></dt>
<dd><p>Specify read timeout for HTTP/2 and SPDY frontend
connection.</p>
<p>Default: <tt class="docutils literal"><span class="pre">180</span></tt></p>
<p>Default: <tt class="docutils literal"><span class="pre">180s</span></tt></p>
</dd></dl>
<dl class="option">
<dt id="cmdoption--frontend-read-timeout">
<tt class="descname">--frontend-read-timeout</tt><tt class="descclassname">=&lt;SEC&gt;</tt><a class="headerlink" href="#cmdoption--frontend-read-timeout" title="Permalink to this definition"></a></dt>
<tt class="descname">--frontend-read-timeout</tt><tt class="descclassname">=&lt;DURATION&gt;</tt><a class="headerlink" href="#cmdoption--frontend-read-timeout" title="Permalink to this definition"></a></dt>
<dd><p>Specify read timeout for HTTP/1.1 frontend connection.</p>
<p>Default: <tt class="docutils literal"><span class="pre">180</span></tt></p>
<p>Default: <tt class="docutils literal"><span class="pre">180s</span></tt></p>
</dd></dl>
<dl class="option">
<dt id="cmdoption--frontend-write-timeout">
<tt class="descname">--frontend-write-timeout</tt><tt class="descclassname">=&lt;SEC&gt;</tt><a class="headerlink" href="#cmdoption--frontend-write-timeout" title="Permalink to this definition"></a></dt>
<tt class="descname">--frontend-write-timeout</tt><tt class="descclassname">=&lt;DURATION&gt;</tt><a class="headerlink" href="#cmdoption--frontend-write-timeout" title="Permalink to this definition"></a></dt>
<dd><p>Specify write timeout for all frontend connections.</p>
<p>Default: <tt class="docutils literal"><span class="pre">30</span></tt></p>
<p>Default: <tt class="docutils literal"><span class="pre">30s</span></tt></p>
</dd></dl>
<dl class="option">
<dt id="cmdoption--stream-read-timeout">
<tt class="descname">--stream-read-timeout</tt><tt class="descclassname">=&lt;SEC&gt;</tt><a class="headerlink" href="#cmdoption--stream-read-timeout" title="Permalink to this definition"></a></dt>
<tt class="descname">--stream-read-timeout</tt><tt class="descclassname">=&lt;DURATION&gt;</tt><a class="headerlink" href="#cmdoption--stream-read-timeout" title="Permalink to this definition"></a></dt>
<dd><p>Specify read timeout for HTTP/2 and SPDY streams. 0
means no timeout.</p>
<p>Default: <tt class="docutils literal"><span class="pre">0</span></tt></p>
@ -458,7 +474,7 @@ means no timeout.</p>
<dl class="option">
<dt id="cmdoption--stream-write-timeout">
<tt class="descname">--stream-write-timeout</tt><tt class="descclassname">=&lt;SEC&gt;</tt><a class="headerlink" href="#cmdoption--stream-write-timeout" title="Permalink to this definition"></a></dt>
<tt class="descname">--stream-write-timeout</tt><tt class="descclassname">=&lt;DURATION&gt;</tt><a class="headerlink" href="#cmdoption--stream-write-timeout" title="Permalink to this definition"></a></dt>
<dd><p>Specify write timeout for HTTP/2 and SPDY streams. 0
means no timeout.</p>
<p>Default: <tt class="docutils literal"><span class="pre">0</span></tt></p>
@ -466,37 +482,37 @@ means no timeout.</p>
<dl class="option">
<dt id="cmdoption--backend-read-timeout">
<tt class="descname">--backend-read-timeout</tt><tt class="descclassname">=&lt;SEC&gt;</tt><a class="headerlink" href="#cmdoption--backend-read-timeout" title="Permalink to this definition"></a></dt>
<tt class="descname">--backend-read-timeout</tt><tt class="descclassname">=&lt;DURATION&gt;</tt><a class="headerlink" href="#cmdoption--backend-read-timeout" title="Permalink to this definition"></a></dt>
<dd><p>Specify read timeout for backend connection.</p>
<p>Default: <tt class="docutils literal"><span class="pre">180</span></tt></p>
<p>Default: <tt class="docutils literal"><span class="pre">180s</span></tt></p>
</dd></dl>
<dl class="option">
<dt id="cmdoption--backend-write-timeout">
<tt class="descname">--backend-write-timeout</tt><tt class="descclassname">=&lt;SEC&gt;</tt><a class="headerlink" href="#cmdoption--backend-write-timeout" title="Permalink to this definition"></a></dt>
<tt class="descname">--backend-write-timeout</tt><tt class="descclassname">=&lt;DURATION&gt;</tt><a class="headerlink" href="#cmdoption--backend-write-timeout" title="Permalink to this definition"></a></dt>
<dd><p>Specify write timeout for backend connection.</p>
<p>Default: <tt class="docutils literal"><span class="pre">30</span></tt></p>
<p>Default: <tt class="docutils literal"><span class="pre">30s</span></tt></p>
</dd></dl>
<dl class="option">
<dt id="cmdoption--backend-keep-alive-timeout">
<tt class="descname">--backend-keep-alive-timeout</tt><tt class="descclassname">=&lt;SEC&gt;</tt><a class="headerlink" href="#cmdoption--backend-keep-alive-timeout" title="Permalink to this definition"></a></dt>
<tt class="descname">--backend-keep-alive-timeout</tt><tt class="descclassname">=&lt;DURATION&gt;</tt><a class="headerlink" href="#cmdoption--backend-keep-alive-timeout" title="Permalink to this definition"></a></dt>
<dd><p>Specify keep-alive timeout for backend connection.</p>
<p>Default: <tt class="docutils literal"><span class="pre">600</span></tt></p>
<p>Default: <tt class="docutils literal"><span class="pre">2s</span></tt></p>
</dd></dl>
<dl class="option">
<dt id="cmdoption--listener-disable-timeout">
<tt class="descname">--listener-disable-timeout</tt><tt class="descclassname">=&lt;SEC&gt;</tt><a class="headerlink" href="#cmdoption--listener-disable-timeout" title="Permalink to this definition"></a></dt>
<tt class="descname">--listener-disable-timeout</tt><tt class="descclassname">=&lt;DURATION&gt;</tt><a class="headerlink" href="#cmdoption--listener-disable-timeout" title="Permalink to this definition"></a></dt>
<dd><p>After accepting connection failed, connection listener
is disabled for a given time in seconds. Specifying 0
is disabled for a given amount of time. Specifying 0
disables this feature.</p>
<p>Default: <tt class="docutils literal"><span class="pre">0</span></tt></p>
</dd></dl>
</div>
<div class="section" id="ssl-tls">
<h3>SSL/TLS:<a class="headerlink" href="#ssl-tls" title="Permalink to this headline"></a></h3>
<h3>SSL/TLS<a class="headerlink" href="#ssl-tls" title="Permalink to this headline"></a></h3>
<dl class="option">
<dt id="cmdoption--ciphers">
<tt class="descname">--ciphers</tt><tt class="descclassname">=&lt;SUITE&gt;</tt><a class="headerlink" href="#cmdoption--ciphers" title="Permalink to this definition"></a></dt>
@ -564,7 +580,7 @@ protocol comes first. This is used in both ALPN and
NPN. The parameter must be delimited by a single comma
only and any white spaces are treated as a part of
protocol string.</p>
<p>Default: <tt class="docutils literal"><span class="pre">h2-16,h2-14,spdy/3.1,http/1.1</span></tt></p>
<p>Default: <tt class="docutils literal"><span class="pre">h2,h2-16,h2-14,spdy/3.1,http/1.1</span></tt></p>
</dd></dl>
<dl class="option">
@ -642,7 +658,7 @@ session ticket key is shared across all worker threads.</p>
</div>
<div class="section" id="http-2-and-spdy">
<h3>HTTP/2 and SPDY:<a class="headerlink" href="#http-2-and-spdy" title="Permalink to this headline"></a></h3>
<h3>HTTP/2 and SPDY<a class="headerlink" href="#http-2-and-spdy" title="Permalink to this headline"></a></h3>
<dl class="option">
<dt id="cmdoption-c">
<span id="cmdoption--http2-max-concurrent-streams"></span><tt class="descname">-c</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">--http2-max-concurrent-streams</tt><tt class="descclassname">=&lt;N&gt;</tt><a class="headerlink" href="#cmdoption-c" title="Permalink to this definition"></a></dt>
@ -712,9 +728,17 @@ meant for debugging purpose and not intended to enhance
protocol security.</p>
</dd></dl>
<dl class="option">
<dt id="cmdoption--no-server-push">
<tt class="descname">--no-server-push</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption--no-server-push" title="Permalink to this definition"></a></dt>
<dd><p>Disable HTTP/2 server push. Server push is only
supported by default mode and HTTP/2 frontend. SPDY
frontend does not support server push.</p>
</dd></dl>
</div>
<div class="section" id="mode">
<h3>Mode:<a class="headerlink" href="#mode" title="Permalink to this headline"></a></h3>
<h3>Mode<a class="headerlink" href="#mode" title="Permalink to this headline"></a></h3>
<dl class="describe">
<dt>
<tt class="descname">(default mode)</tt></dt>
@ -762,7 +786,7 @@ use as a forward proxy.</p>
</div>
<div class="section" id="logging">
<h3>Logging:<a class="headerlink" href="#logging" title="Permalink to this headline"></a></h3>
<h3>Logging<a class="headerlink" href="#logging" title="Permalink to this headline"></a></h3>
<dl class="option">
<dt id="cmdoption-L">
<span id="cmdoption--log-level"></span><tt class="descname">-L</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">--log-level</tt><tt class="descclassname">=&lt;LEVEL&gt;</tt><a class="headerlink" href="#cmdoption-L" title="Permalink to this definition"></a></dt>
@ -837,7 +861,7 @@ signal to nghttpx.</p>
</div>
<div class="section" id="http">
<h3>HTTP:<a class="headerlink" href="#http" title="Permalink to this headline"></a></h3>
<h3>HTTP<a class="headerlink" href="#http" title="Permalink to this headline"></a></h3>
<dl class="option">
<dt id="cmdoption--add-x-forwarded-for">
<tt class="descname">--add-x-forwarded-for</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption--add-x-forwarded-for" title="Permalink to this definition"></a></dt>
@ -868,6 +892,15 @@ is received, it is left unaltered.</p>
altered regardless of this option.</p>
</dd></dl>
<dl class="option">
<dt id="cmdoption--no-host-rewrite">
<tt class="descname">--no-host-rewrite</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption--no-host-rewrite" title="Permalink to this definition"></a></dt>
<dd><p>Don't rewrite host and :authority header fields on
<a class="reference internal" href="#cmdoption--http2-bridge"><em class="xref std std-option">--http2-bridge</em></a>, <a class="reference internal" href="#cmdoption--client"><em class="xref std std-option">--client</em></a> and default mode. For
<a class="reference internal" href="#cmdoption--http2-proxy"><em class="xref std std-option">--http2-proxy</em></a> and <a class="reference internal" href="#cmdoption--client-proxy"><em class="xref std std-option">--client-proxy</em></a> mode, these headers
will not be altered regardless of this option.</p>
</dd></dl>
<dl class="option">
<dt id="cmdoption--altsvc">
<tt class="descname">--altsvc</tt><tt class="descclassname">=&lt;PROTOID,PORT[,HOST,[ORIGIN]]&gt;</tt><a class="headerlink" href="#cmdoption--altsvc" title="Permalink to this definition"></a></dt>
@ -891,7 +924,7 @@ Example: <a class="reference internal" href="#cmdoption--add-response-header"><e
</div>
<div class="section" id="debug">
<h3>Debug:<a class="headerlink" href="#debug" title="Permalink to this headline"></a></h3>
<h3>Debug<a class="headerlink" href="#debug" title="Permalink to this headline"></a></h3>
<dl class="option">
<dt id="cmdoption--frontend-http2-dump-request-header">
<tt class="descname">--frontend-http2-dump-request-header</tt><tt class="descclassname">=&lt;PATH&gt;</tt><a class="headerlink" href="#cmdoption--frontend-http2-dump-request-header" title="Permalink to this definition"></a></dt>
@ -922,7 +955,7 @@ is not thread safe and MUST NOT be used with option
</div>
<div class="section" id="process">
<h3>Process:<a class="headerlink" href="#process" title="Permalink to this headline"></a></h3>
<h3>Process<a class="headerlink" href="#process" title="Permalink to this headline"></a></h3>
<dl class="option">
<dt id="cmdoption-D">
<span id="cmdoption--daemon"></span><tt class="descname">-D</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">--daemon</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-D" title="Permalink to this definition"></a></dt>
@ -945,7 +978,7 @@ be used to drop root privileges.</p>
</div>
<div class="section" id="misc">
<h3>Misc:<a class="headerlink" href="#misc" title="Permalink to this headline"></a></h3>
<h3>Misc<a class="headerlink" href="#misc" title="Permalink to this headline"></a></h3>
<dl class="option">
<dt id="cmdoption--conf">
<tt class="descname">--conf</tt><tt class="descclassname">=&lt;PATH&gt;</tt><a class="headerlink" href="#cmdoption--conf" title="Permalink to this definition"></a></dt>
@ -967,6 +1000,9 @@ be used to drop root privileges.</p>
<p>The &lt;SIZE&gt; argument is an integer and an optional unit (e.g., 10K is
10 * 1024). Units are K, M and G (powers of 1024).</p>
<p>The &lt;DURATION&gt; argument is an integer and an optional unit (e.g., 1s
is 1 second and 500ms is 500 milliseconds). Units are s or ms. If
a unit is omitted, a second is used as unit.</p>
</div>
</div>
<div class="section" id="files">
@ -1009,6 +1045,40 @@ After new process comes up, sending SIGQUIT to the original process
to perform hot swapping.</dd>
</dl>
</div>
<div class="section" id="server-push">
<h2>SERVER PUSH<a class="headerlink" href="#server-push" title="Permalink to this headline"></a></h2>
<p>nghttpx supports HTTP/2 server push in default mode. nghttpx looks
for Link header field (<a class="reference external" href="http://tools.ietf.org/html/rfc5988">RFC 5988</a>) in response headers from
backend server and extracts URI-reference with parameter
<tt class="docutils literal"><span class="pre">rel=preload</span></tt> (see <a class="reference external" href="http://w3c.github.io/preload/#interoperability-with-http-link-header">preload</a>)
and pushes those URIs to the frontend client. Here is a sample Link
header field to initiate server push:</p>
<div class="highlight-http"><div class="highlight"><pre>Link: &lt;/fonts/font.woff&gt;; rel=preload
Link: &lt;/css/theme.css&gt;; rel=preload
</pre></div>
</div>
<p>Currently, the following restrictions are applied for server push:</p>
<ol class="arabic simple">
<li>URI-reference must not contain authority. If it exists, it is not
pushed. <tt class="docutils literal"><span class="pre">/fonts/font.woff</span></tt> and <tt class="docutils literal"><span class="pre">css/theme.css</span></tt> are eligible to
be pushed. <tt class="docutils literal"><span class="pre">https://example.org/fonts/font.woff</span></tt> and
<tt class="docutils literal"><span class="pre">//example.org/css/theme.css</span></tt> are not.</li>
<li>The associated stream must have method &quot;GET&quot; or &quot;POST&quot;. The
associated stream's status code must be 200.</li>
</ol>
<p>These limitations may be loosened in the future release.</p>
</div>
<div class="section" id="unix-domain-socket">
<h2>UNIX DOMAIN SOCKET<a class="headerlink" href="#unix-domain-socket" title="Permalink to this headline"></a></h2>
<p>nghttpx supports UNIX domain socket with a filename for both frontend
and backend connections.</p>
<p>Please note that current nghttpx implementation does not delete a
socket with a filename. And on start up, if nghttpx detects that the
specified socket already exists in the file system, nghttpx first
deletes it. However, if SIGUSR2 is used to execute new binary and
both old and new configurations use same filename, new binary does not
delete the socket and continues to use it.</p>
</div>
<div class="section" id="see-also">
<h2>SEE ALSO<a class="headerlink" href="#see-also" title="Permalink to this headline"></a></h2>
<p><em class="manpage">nghttp(1)</em>, <em class="manpage">nghttpd(1)</em>, <em class="manpage">h2load(1)</em></p>
@ -1054,7 +1124,7 @@ to perform hot swapping.</dd>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.7.2-DEV',
VERSION:'0.7.8-DEV',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: false

Binary file not shown.

View File

@ -7,7 +7,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>nghttp2 - HTTP/2 C Library &mdash; nghttp2 0.7.2-DEV documentation</title>
<title>nghttp2 - HTTP/2 C Library &mdash; nghttp2 0.7.8-DEV documentation</title>
@ -28,7 +28,7 @@
<link rel="top" title="nghttp2 0.7.2-DEV documentation" href="index.html"/>
<link rel="top" title="nghttp2 0.7.8-DEV documentation" href="index.html"/>
<link rel="next" title="Contribution Guidelines" href="contribute.html"/>
<link rel="prev" title="nghttp2 - HTTP/2 C Library" href="index.html"/>
@ -100,30 +100,33 @@
<li class="toctree-l1"><a class="reference internal" href="nghttp.1.html">nghttp(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpd.1.html">nghttpd(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpx.1.html">nghttpx(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#files">FILES</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#signals">SIGNALS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#server-push">SERVER PUSH</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#unix-domain-socket">UNIX DOMAIN SOCKET</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load.1.html">h2load(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#output">OUTPUT</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
@ -139,7 +142,7 @@
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#rewriting-location-header-field">Rewriting location header field</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#hot-swapping">Hot swapping</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#re-opening-log-files">Re-opening log files</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-http-1-backend-addresses">Multiple HTTP/1 backend addresses</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-backend-addresses">Multiple backend addresses</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load-howto.html">h2load - HTTP/2 benchmarking tool - HOW-TO</a><ul>
@ -153,6 +156,7 @@
<li class="toctree-l1"><a class="reference internal" href="apiref.html">API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#includes">Includes</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#remarks">Remarks</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#http-messaging">HTTP Messaging</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#macros">Macros</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#enums">Enums</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#types-structs-unions-and-typedefs">Types (structs, unions and typedefs)</a></li>
@ -161,6 +165,7 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="libnghttp2_asio.html">libnghttp2_asio: High level HTTP/2 C++ library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#server-api">Server API</a></li>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#client-api">Client API</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="python-apiref.html">Python API Reference</a><ul>
@ -170,6 +175,8 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2.h.html">nghttp2.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2ver.h.html">nghttp2ver.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_server.h.html">asio_http2_server.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_client.h.html">asio_http2_client.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2.h.html">asio_http2.h</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2">Source</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2/issues">Issues</a></li>
@ -255,8 +262,9 @@ compression
implementation.</p>
<ul>
<li><p class="first"><a class="reference external" href="https://nghttp2.org/">https://nghttp2.org/</a> (TLS + ALPN/NPN)</p>
<p>NPN offer <tt class="docutils literal"><span class="pre">h2-14</span></tt>, <tt class="docutils literal"><span class="pre">spdy/3.1</span></tt> and <tt class="docutils literal"><span class="pre">http/1.1</span></tt>.</p>
<p>This endpoint requires TLSv1.2 for HTTP/2 connection.</p>
<p>This endpoint supports <tt class="docutils literal"><span class="pre">h2</span></tt>, <tt class="docutils literal"><span class="pre">h2-16</span></tt>, <tt class="docutils literal"><span class="pre">h2-14</span></tt>, <tt class="docutils literal"><span class="pre">spdy/3.1</span></tt>
and <tt class="docutils literal"><span class="pre">http/1.1</span></tt> via ALPN/NPN and requires TLSv1.2 for HTTP/2
connection.</p>
</li>
<li><p class="first"><a class="reference external" href="http://nghttp2.org/">http://nghttp2.org/</a> (Upgrade / Direct)</p>
<p><tt class="docutils literal"><span class="pre">h2c-14</span></tt> and <tt class="docutils literal"><span class="pre">http/1.1</span></tt>.</p>
@ -322,25 +330,9 @@ resource) in <tt class="docutils literal"><span class="pre">nghttp</span></tt>,
</ul>
<p>If you are using Ubuntu 14.04 LTS, you need the following packages
installed:</p>
<ul class="simple">
<li>make</li>
<li>binutils</li>
<li>autoconf</li>
<li>automake</li>
<li>autotools-dev</li>
<li>libtool</li>
<li>pkg-config</li>
<li>zlib1g-dev</li>
<li>libcunit1-dev</li>
<li>libssl-dev</li>
<li>libxml2-dev</li>
<li>libev-dev</li>
<li>libevent-dev</li>
<li>libjansson-dev</li>
<li>libjemalloc-dev</li>
<li>cython</li>
<li>python3.4-dev</li>
</ul>
<div class="highlight-c"><div class="highlight"><pre><span class="n">apt</span><span class="o">-</span><span class="n">get</span> <span class="n">install</span> <span class="n">make</span> <span class="n">binutils</span> <span class="n">autoconf</span> <span class="n">automake</span> <span class="n">autotools</span><span class="o">-</span><span class="n">dev</span> <span class="n">libtool</span> <span class="n">pkg</span><span class="o">-</span><span class="n">config</span> <span class="n">zlib1g</span><span class="o">-</span><span class="n">dev</span> <span class="n">libcunit1</span><span class="o">-</span><span class="n">dev</span> <span class="n">libssl</span><span class="o">-</span><span class="n">dev</span> <span class="n">libxml2</span><span class="o">-</span><span class="n">dev</span> <span class="n">libev</span><span class="o">-</span><span class="n">dev</span> <span class="n">libevent</span><span class="o">-</span><span class="n">dev</span> <span class="n">libjansson</span><span class="o">-</span><span class="n">dev</span> <span class="n">libjemalloc</span><span class="o">-</span><span class="n">dev</span> <span class="n">cython</span> <span class="n">python3</span><span class="mf">.4</span><span class="o">-</span><span class="n">dev</span>
</pre></div>
</div>
<p>spdylay is not packaged in Ubuntu, so you need to build it yourself:
<a class="reference external" href="http://tatsuhiro-t.github.io/spdylay/">http://tatsuhiro-t.github.io/spdylay/</a></p>
</div>
@ -414,7 +406,7 @@ following command under <tt class="docutils literal"><span class="pre">integrati
with prior knowledge, HTTP Upgrade and NPN/ALPN TLS extension.</p>
<p>It has verbose output mode for framing information. Here is sample
output from <tt class="docutils literal"><span class="pre">nghttp</span></tt> client:</p>
<div class="highlight-c"><div class="highlight"><pre>$ src/nghttp -nv https://nghttp2.org
<div class="highlight-c"><div class="highlight"><pre>$ nghttp -nv https://nghttp2.org
[ 0.033][NPN] server offers:
* h2-14
* spdy/3.1
@ -483,7 +475,7 @@ The negotiated protocol: h2-14
</pre></div>
</div>
<p>The HTTP Upgrade is performed like this:</p>
<div class="highlight-c"><div class="highlight"><pre>$ src/nghttp -nvu http://nghttp2.org
<div class="highlight-c"><div class="highlight"><pre>$ nghttp -nvu http://nghttp2.org
[ 0.013] HTTP Upgrade request
GET / HTTP/1.1
Host: nghttp2.org
@ -551,6 +543,34 @@ Upgrade: h2c-14
(last_stream_id=0, error_code=NO_ERROR(0), opaque_data(0)=[])
</pre></div>
</div>
<p>With <tt class="docutils literal"><span class="pre">-s</span></tt> option, <tt class="docutils literal"><span class="pre">nghttp</span></tt> prints out some timing information for
requests, sorted by completion time:</p>
<div class="highlight-c"><div class="highlight"><pre>$ nghttp -nas https://nghttp2.org/
***** Statistics *****
Request timing:
complete: relative time from protocol handshake to stream close
request: relative time from protocol handshake to request
transmission. If &#39;*&#39; is shown, this was pushed by server.
process: time for request and response
code: HTTP status code
size: number of bytes received as response body without
inflation.
URI: request URI
sorted by &#39;complete&#39;
complete request process code size request path
+11.07ms +120us 10.95ms 200 9K /
+16.77ms * +8.80ms 7.98ms 200 8K /stylesheets/screen.css
+27.00ms +11.16ms 15.84ms 200 3K /javascripts/octopress.js
+27.40ms +11.16ms 16.24ms 200 3K /javascripts/modernizr-2.0.js
+76.14ms +11.17ms 64.97ms 200 171K /images/posts/with-pri-blog.png
+88.52ms +11.17ms 77.36ms 200 174K /images/posts/without-pri-blog.png
</pre></div>
</div>
<p>With <tt class="docutils literal"><span class="pre">-r</span></tt> option, <tt class="docutils literal"><span class="pre">nghttp</span></tt> writes more detailed timing data to
given file in HAR format.</p>
</div>
<div class="section" id="nghttpd-server">
<h3>nghttpd - server<a class="headerlink" href="#nghttpd-server" title="Permalink to this headline"></a></h3>
@ -562,7 +582,7 @@ HTTP/2 connection. No HTTP Upgrade is supported.</p>
<p><tt class="docutils literal"><span class="pre">-p</span></tt> option allows users to configure server push.</p>
<p>Just like <tt class="docutils literal"><span class="pre">nghttp</span></tt>, it has verbose output mode for framing
information. Here is sample output from <tt class="docutils literal"><span class="pre">nghttpd</span></tt> server:</p>
<div class="highlight-c"><div class="highlight"><pre>$ src/nghttpd --no-tls -v 8080
<div class="highlight-c"><div class="highlight"><pre>$ nghttpd --no-tls -v 8080
IPv4: listen on port 8080
IPv6: listen on port 8080
[id=1] [ 15.921] send SETTINGS frame &lt;length=10, flags=0x00, stream_id=0&gt;
@ -615,7 +635,8 @@ IPv6: listen on port 8080
<div class="section" id="nghttpx-proxy">
<h3>nghttpx - proxy<a class="headerlink" href="#nghttpx-proxy" title="Permalink to this headline"></a></h3>
<p><tt class="docutils literal"><span class="pre">nghttpx</span></tt> is a multi-threaded reverse proxy for <tt class="docutils literal"><span class="pre">h2-14</span></tt>, SPDY and
HTTP/1.1 and powers nghttp2.org site. It has several operation modes:</p>
HTTP/1.1 and powers nghttp2.org site and supports HTTP/2 server push.
It has several operation modes:</p>
<table border="1" class="docutils">
<colgroup>
<col width="25%" />
@ -671,7 +692,6 @@ SSL/TLS in the backend connection by deafult. To disable SSL/TLS, use
<tt class="docutils literal"><span class="pre">--backend-no-tls</span></tt> option.</p>
<p><tt class="docutils literal"><span class="pre">nghttpx</span></tt> supports configuration file. See <tt class="docutils literal"><span class="pre">--conf</span></tt> option and
sample configuration file <tt class="docutils literal"><span class="pre">nghttpx.conf.sample</span></tt>.</p>
<p><tt class="docutils literal"><span class="pre">nghttpx</span></tt> does not support server push.</p>
<p>In the default mode, (without any of <tt class="docutils literal"><span class="pre">--http2-proxy</span></tt>,
<tt class="docutils literal"><span class="pre">--http2-bridge</span></tt>, <tt class="docutils literal"><span class="pre">--client-proxy</span></tt> and <tt class="docutils literal"><span class="pre">--client</span></tt> options),
<tt class="docutils literal"><span class="pre">nghttpx</span></tt> works as reverse proxy to the backend server:</p>
@ -747,8 +767,11 @@ The SPDY support is enabled if the program was built with spdylay
library. The UI of <tt class="docutils literal"><span class="pre">h2load</span></tt> is heavily inspired by <tt class="docutils literal"><span class="pre">weighttp</span></tt>
(<a class="reference external" href="https://github.com/lighttpd/weighttp">https://github.com/lighttpd/weighttp</a>). The typical usage is as
follows:</p>
<div class="highlight-c"><div class="highlight"><pre>$ src/h2load -n1000 -c10 -m10 https://127.0.0.1:8443/
<div class="highlight-c"><div class="highlight"><pre>$ h2load -n100000 -c100 -m100 https://localhost:8443/
starting benchmark...
spawning thread #0: 100 concurrent clients, 100000 total requests
Protocol: TLSv1.2
Cipher: ECDHE-RSA-AES128-GCM-SHA256
progress: 10% done
progress: 20% done
progress: 30% done
@ -760,16 +783,18 @@ progress: 80% done
progress: 90% done
progress: 100% done
finished in 0 sec, 152 millisec and 152 microsec, 6572 req/s, 749 kbytes/s
requests: 1000 total, 1000 started, 1000 done, 0 succeeded, 1000 failed, 0 errored
status codes: 0 2xx, 0 3xx, 1000 4xx, 0 5xx
traffic: 141100 bytes total, 840 bytes headers, 116000 bytes data
finished in 7.10s, 14092 req/s, 55.67MB/s
requests: 100000 total, 100000 started, 100000 done, 100000 succeeded, 0 failed, 0 errored
status codes: 100000 2xx, 0 3xx, 0 4xx, 0 5xx
traffic: 414200800 bytes total, 2723100 bytes headers, 409600000 bytes data
min max mean sd +/- sd
time for request: 283.86ms 1.46s 659.70ms 150.87ms 84.68%
</pre></div>
</div>
<p>The above example issued total 1000 requests, using 10 concurrent
clients (thus 10 HTTP/2 sessions), and maximum 10 streams per client.
With <tt class="docutils literal"><span class="pre">-t</span></tt> option, <tt class="docutils literal"><span class="pre">h2load</span></tt> will use multiple native threads to
avoid saturating single core on client side.</p>
<p>The above example issued total 100000 requests, using 100 concurrent
clients (in other words, 100 HTTP/2 sessions), and maximum 100 streams
per client. With <tt class="docutils literal"><span class="pre">-t</span></tt> option, <tt class="docutils literal"><span class="pre">h2load</span></tt> will use multiple native
threads to avoid saturating single core on client side.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last"><strong>Don't use this tool against publicly available servers.</strong> That is
@ -1183,7 +1208,7 @@ corresponding header set was processed. The format is the same as
<p>libnghttp2_asio is C++ library built on top of libnghttp2 and provides
high level abstraction API to build HTTP/2 applications. It depends
on Boost::ASIO library and OpenSSL. Currently libnghttp2_asio
provides server side API.</p>
provides client and server API.</p>
<p>libnghttp2_asio is not built by default. Use <tt class="docutils literal"><span class="pre">--enable-asio-lib</span></tt>
configure flag to build libnghttp2_asio. The required Boost libraries
are:</p>
@ -1195,19 +1220,73 @@ are:</p>
<p>Server API is designed to build HTTP/2 server very easily to utilize
C++11 anonymous function and closure. The bare minimum example of
HTTP/2 server looks like this:</p>
<div class="highlight-cpp"><div class="highlight"><pre><span class="cp">#include &lt;nghttp2/asio_http2.h&gt;</span>
<div class="highlight-cpp"><div class="highlight"><pre><span class="cp">#include &lt;nghttp2/asio_http2_server.h&gt;</span>
<span class="k">using</span> <span class="k">namespace</span> <span class="n">nghttp2</span><span class="o">::</span><span class="n">asio_http2</span><span class="p">;</span>
<span class="k">using</span> <span class="k">namespace</span> <span class="n">nghttp2</span><span class="o">::</span><span class="n">asio_http2</span><span class="o">::</span><span class="n">server</span><span class="p">;</span>
<span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span> <span class="o">*</span><span class="n">argv</span><span class="p">[])</span> <span class="p">{</span>
<span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_code</span> <span class="n">ec</span><span class="p">;</span>
<span class="n">http2</span> <span class="n">server</span><span class="p">;</span>
<span class="n">server</span><span class="p">.</span><span class="n">listen</span><span class="p">(</span><span class="s">&quot;*&quot;</span><span class="p">,</span> <span class="mi">3000</span><span class="p">,</span> <span class="p">[](</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">shared_ptr</span><span class="o">&lt;</span><span class="n">request</span><span class="o">&gt;</span> <span class="o">&amp;</span><span class="n">req</span><span class="p">,</span>
<span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">shared_ptr</span><span class="o">&lt;</span><span class="n">response</span><span class="o">&gt;</span> <span class="o">&amp;</span><span class="n">res</span><span class="p">)</span> <span class="p">{</span>
<span class="n">res</span><span class="o">-&gt;</span><span class="n">write_head</span><span class="p">(</span><span class="mi">200</span><span class="p">);</span>
<span class="n">res</span><span class="o">-&gt;</span><span class="n">end</span><span class="p">(</span><span class="s">&quot;hello, world&quot;</span><span class="p">);</span>
<span class="n">server</span><span class="p">.</span><span class="n">handle</span><span class="p">(</span><span class="s">&quot;/&quot;</span><span class="p">,</span> <span class="p">[](</span><span class="k">const</span> <span class="n">request</span> <span class="o">&amp;</span><span class="n">req</span><span class="p">,</span> <span class="k">const</span> <span class="n">response</span> <span class="o">&amp;</span><span class="n">res</span><span class="p">)</span> <span class="p">{</span>
<span class="n">res</span><span class="p">.</span><span class="n">write_head</span><span class="p">(</span><span class="mi">200</span><span class="p">);</span>
<span class="n">res</span><span class="p">.</span><span class="n">end</span><span class="p">(</span><span class="s">&quot;hello, world</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="p">});</span>
<span class="k">if</span> <span class="p">(</span><span class="n">server</span><span class="p">.</span><span class="n">listen_and_serve</span><span class="p">(</span><span class="n">ec</span><span class="p">,</span> <span class="s">&quot;localhost&quot;</span><span class="p">,</span> <span class="s">&quot;3000&quot;</span><span class="p">))</span> <span class="p">{</span>
<span class="n">std</span><span class="o">::</span><span class="n">cerr</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;error: &quot;</span> <span class="o">&lt;&lt;</span> <span class="n">ec</span><span class="p">.</span><span class="n">message</span><span class="p">()</span> <span class="o">&lt;&lt;</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
<p>Here is the sample code for client API use:</p>
<div class="highlight-cpp"><div class="highlight"><pre><span class="cp">#include &lt;iostream&gt;</span>
<span class="cp">#include &lt;nghttp2/asio_http2_client.h&gt;</span>
<span class="k">using</span> <span class="n">boost</span><span class="o">::</span><span class="n">asio</span><span class="o">::</span><span class="n">ip</span><span class="o">::</span><span class="n">tcp</span><span class="p">;</span>
<span class="k">using</span> <span class="k">namespace</span> <span class="n">nghttp2</span><span class="o">::</span><span class="n">asio_http2</span><span class="p">;</span>
<span class="k">using</span> <span class="k">namespace</span> <span class="n">nghttp2</span><span class="o">::</span><span class="n">asio_http2</span><span class="o">::</span><span class="n">client</span><span class="p">;</span>
<span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span> <span class="o">*</span><span class="n">argv</span><span class="p">[])</span> <span class="p">{</span>
<span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_code</span> <span class="n">ec</span><span class="p">;</span>
<span class="n">boost</span><span class="o">::</span><span class="n">asio</span><span class="o">::</span><span class="n">io_service</span> <span class="n">io_service</span><span class="p">;</span>
<span class="c1">// connect to localhost:3000</span>
<span class="n">session</span> <span class="n">sess</span><span class="p">(</span><span class="n">io_service</span><span class="p">,</span> <span class="s">&quot;localhost&quot;</span><span class="p">,</span> <span class="s">&quot;3000&quot;</span><span class="p">);</span>
<span class="n">sess</span><span class="p">.</span><span class="n">on_connect</span><span class="p">([</span><span class="o">&amp;</span><span class="n">sess</span><span class="p">](</span><span class="n">tcp</span><span class="o">::</span><span class="n">resolver</span><span class="o">::</span><span class="n">iterator</span> <span class="n">endpoint_it</span><span class="p">)</span> <span class="p">{</span>
<span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_code</span> <span class="n">ec</span><span class="p">;</span>
<span class="k">auto</span> <span class="n">req</span> <span class="o">=</span> <span class="n">sess</span><span class="p">.</span><span class="n">submit</span><span class="p">(</span><span class="n">ec</span><span class="p">,</span> <span class="s">&quot;GET&quot;</span><span class="p">,</span> <span class="s">&quot;http://localhost:3000/&quot;</span><span class="p">);</span>
<span class="n">req</span><span class="o">-&gt;</span><span class="n">on_response</span><span class="p">([](</span><span class="k">const</span> <span class="n">response</span> <span class="o">&amp;</span><span class="n">res</span><span class="p">)</span> <span class="p">{</span>
<span class="c1">// print status code and response header fields.</span>
<span class="n">std</span><span class="o">::</span><span class="n">cerr</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;HTTP/2 &quot;</span> <span class="o">&lt;&lt;</span> <span class="n">res</span><span class="p">.</span><span class="n">status_code</span><span class="p">()</span> <span class="o">&lt;&lt;</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
<span class="k">for</span> <span class="p">(</span><span class="k">auto</span> <span class="o">&amp;</span><span class="nl">kv</span> <span class="p">:</span> <span class="n">res</span><span class="p">.</span><span class="n">header</span><span class="p">())</span> <span class="p">{</span>
<span class="n">std</span><span class="o">::</span><span class="n">cerr</span> <span class="o">&lt;&lt;</span> <span class="n">kv</span><span class="p">.</span><span class="n">first</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;: &quot;</span> <span class="o">&lt;&lt;</span> <span class="n">kv</span><span class="p">.</span><span class="n">second</span><span class="p">.</span><span class="n">value</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">;</span>
<span class="p">}</span>
<span class="n">std</span><span class="o">::</span><span class="n">cerr</span> <span class="o">&lt;&lt;</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
<span class="n">res</span><span class="p">.</span><span class="n">on_data</span><span class="p">([](</span><span class="k">const</span> <span class="kt">uint8_t</span> <span class="o">*</span><span class="n">data</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="kt">size_t</span> <span class="n">len</span><span class="p">)</span> <span class="p">{</span>
<span class="n">std</span><span class="o">::</span><span class="n">cerr</span><span class="p">.</span><span class="n">write</span><span class="p">(</span><span class="k">reinterpret_cast</span><span class="o">&lt;</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*&gt;</span><span class="p">(</span><span class="n">data</span><span class="p">),</span> <span class="n">len</span><span class="p">);</span>
<span class="n">std</span><span class="o">::</span><span class="n">cerr</span> <span class="o">&lt;&lt;</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
<span class="p">});</span>
<span class="p">});</span>
<span class="n">req</span><span class="o">-&gt;</span><span class="n">on_close</span><span class="p">([</span><span class="o">&amp;</span><span class="n">sess</span><span class="p">](</span><span class="kt">uint32_t</span> <span class="n">error_code</span><span class="p">)</span> <span class="p">{</span>
<span class="c1">// shutdown session after first request was done.</span>
<span class="n">sess</span><span class="p">.</span><span class="n">shutdown</span><span class="p">();</span>
<span class="p">});</span>
<span class="p">});</span>
<span class="n">sess</span><span class="p">.</span><span class="n">on_error</span><span class="p">([](</span><span class="k">const</span> <span class="n">boost</span><span class="o">::</span><span class="n">system</span><span class="o">::</span><span class="n">error_code</span> <span class="o">&amp;</span><span class="n">ec</span><span class="p">)</span> <span class="p">{</span>
<span class="n">std</span><span class="o">::</span><span class="n">cerr</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;error: &quot;</span> <span class="o">&lt;&lt;</span> <span class="n">ec</span><span class="p">.</span><span class="n">message</span><span class="p">()</span> <span class="o">&lt;&lt;</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
<span class="p">});</span>
<span class="n">io_service</span><span class="p">.</span><span class="n">run</span><span class="p">();</span>
<span class="p">}</span>
</pre></div>
</div>
@ -1370,7 +1449,7 @@ details.</p>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.7.2-DEV',
VERSION:'0.7.8-DEV',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: false

View File

@ -7,7 +7,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Python Module Index &mdash; nghttp2 0.7.2-DEV documentation</title>
<title>Python Module Index &mdash; nghttp2 0.7.8-DEV documentation</title>
@ -28,7 +28,7 @@
<link rel="top" title="nghttp2 0.7.2-DEV documentation" href="index.html"/>
<link rel="top" title="nghttp2 0.7.8-DEV documentation" href="index.html"/>
<script type="text/javascript">
@ -105,30 +105,33 @@
<li class="toctree-l1"><a class="reference internal" href="nghttp.1.html">nghttp(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpd.1.html">nghttpd(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpx.1.html">nghttpx(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#files">FILES</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#signals">SIGNALS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#server-push">SERVER PUSH</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#unix-domain-socket">UNIX DOMAIN SOCKET</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load.1.html">h2load(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#output">OUTPUT</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
@ -144,7 +147,7 @@
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#rewriting-location-header-field">Rewriting location header field</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#hot-swapping">Hot swapping</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#re-opening-log-files">Re-opening log files</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-http-1-backend-addresses">Multiple HTTP/1 backend addresses</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-backend-addresses">Multiple backend addresses</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load-howto.html">h2load - HTTP/2 benchmarking tool - HOW-TO</a><ul>
@ -158,6 +161,7 @@
<li class="toctree-l1"><a class="reference internal" href="apiref.html">API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#includes">Includes</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#remarks">Remarks</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#http-messaging">HTTP Messaging</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#macros">Macros</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#enums">Enums</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#types-structs-unions-and-typedefs">Types (structs, unions and typedefs)</a></li>
@ -166,6 +170,7 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="libnghttp2_asio.html">libnghttp2_asio: High level HTTP/2 C++ library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#server-api">Server API</a></li>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#client-api">Client API</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="python-apiref.html">Python API Reference</a><ul>
@ -175,6 +180,8 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2.h.html">nghttp2.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2ver.h.html">nghttp2ver.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_server.h.html">asio_http2_server.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_client.h.html">asio_http2_client.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2.h.html">asio_http2.h</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2">Source</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2/issues">Issues</a></li>
@ -260,7 +267,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.7.2-DEV',
VERSION:'0.7.8-DEV',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: false

View File

@ -7,7 +7,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Python API Reference &mdash; nghttp2 0.7.2-DEV documentation</title>
<title>Python API Reference &mdash; nghttp2 0.7.8-DEV documentation</title>
@ -28,7 +28,7 @@
<link rel="top" title="nghttp2 0.7.2-DEV documentation" href="index.html"/>
<link rel="top" title="nghttp2 0.7.8-DEV documentation" href="index.html"/>
<link rel="next" title="nghttp2.h" href="nghttp2.h.html"/>
<link rel="prev" title="libnghttp2_asio: High level HTTP/2 C++ library" href="libnghttp2_asio.html"/>
@ -100,30 +100,33 @@
<li class="toctree-l1"><a class="reference internal" href="nghttp.1.html">nghttp(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpd.1.html">nghttpd(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpx.1.html">nghttpx(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#files">FILES</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#signals">SIGNALS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#server-push">SERVER PUSH</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#unix-domain-socket">UNIX DOMAIN SOCKET</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load.1.html">h2load(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#output">OUTPUT</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
@ -139,7 +142,7 @@
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#rewriting-location-header-field">Rewriting location header field</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#hot-swapping">Hot swapping</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#re-opening-log-files">Re-opening log files</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-http-1-backend-addresses">Multiple HTTP/1 backend addresses</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-backend-addresses">Multiple backend addresses</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load-howto.html">h2load - HTTP/2 benchmarking tool - HOW-TO</a><ul>
@ -153,6 +156,7 @@
<li class="toctree-l1"><a class="reference internal" href="apiref.html">API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#includes">Includes</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#remarks">Remarks</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#http-messaging">HTTP Messaging</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#macros">Macros</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#enums">Enums</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#types-structs-unions-and-typedefs">Types (structs, unions and typedefs)</a></li>
@ -161,6 +165,7 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="libnghttp2_asio.html">libnghttp2_asio: High level HTTP/2 C++ library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#server-api">Server API</a></li>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#client-api">Client API</a></li>
</ul>
</li>
<li class="toctree-l1 current"><a class="current reference internal" href="">Python API Reference</a><ul>
@ -170,6 +175,8 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2.h.html">nghttp2.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2ver.h.html">nghttp2ver.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_server.h.html">asio_http2_server.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_client.h.html">asio_http2_client.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2.h.html">asio_http2.h</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2">Source</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2/issues">Issues</a></li>
@ -587,7 +594,7 @@ encoded using UTF-8.</p>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.7.2-DEV',
VERSION:'0.7.8-DEV',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: false

View File

@ -7,7 +7,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Search &mdash; nghttp2 0.7.2-DEV documentation</title>
<title>Search &mdash; nghttp2 0.7.8-DEV documentation</title>
@ -28,7 +28,7 @@
<link rel="top" title="nghttp2 0.7.2-DEV documentation" href="index.html"/>
<link rel="top" title="nghttp2 0.7.8-DEV documentation" href="index.html"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
@ -98,30 +98,33 @@
<li class="toctree-l1"><a class="reference internal" href="nghttp.1.html">nghttp(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpd.1.html">nghttpd(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpx.1.html">nghttpx(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#files">FILES</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#signals">SIGNALS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#server-push">SERVER PUSH</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#unix-domain-socket">UNIX DOMAIN SOCKET</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load.1.html">h2load(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#output">OUTPUT</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
@ -137,7 +140,7 @@
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#rewriting-location-header-field">Rewriting location header field</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#hot-swapping">Hot swapping</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#re-opening-log-files">Re-opening log files</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-http-1-backend-addresses">Multiple HTTP/1 backend addresses</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-backend-addresses">Multiple backend addresses</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load-howto.html">h2load - HTTP/2 benchmarking tool - HOW-TO</a><ul>
@ -151,6 +154,7 @@
<li class="toctree-l1"><a class="reference internal" href="apiref.html">API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#includes">Includes</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#remarks">Remarks</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#http-messaging">HTTP Messaging</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#macros">Macros</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#enums">Enums</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#types-structs-unions-and-typedefs">Types (structs, unions and typedefs)</a></li>
@ -159,6 +163,7 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="libnghttp2_asio.html">libnghttp2_asio: High level HTTP/2 C++ library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#server-api">Server API</a></li>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#client-api">Client API</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="python-apiref.html">Python API Reference</a><ul>
@ -168,6 +173,8 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2.h.html">nghttp2.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2ver.h.html">nghttp2ver.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_server.h.html">asio_http2_server.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_client.h.html">asio_http2_client.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2.h.html">asio_http2.h</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2">Source</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2/issues">Issues</a></li>
@ -248,7 +255,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.7.2-DEV',
VERSION:'0.7.8-DEV',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: false

File diff suppressed because one or more lines are too long

View File

@ -7,7 +7,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tutorial: HTTP/2 client &mdash; nghttp2 0.7.2-DEV documentation</title>
<title>Tutorial: HTTP/2 client &mdash; nghttp2 0.7.8-DEV documentation</title>
@ -28,7 +28,7 @@
<link rel="top" title="nghttp2 0.7.2-DEV documentation" href="index.html"/>
<link rel="top" title="nghttp2 0.7.8-DEV documentation" href="index.html"/>
<link rel="next" title="Tutorial: HTTP/2 server" href="tutorial-server.html"/>
<link rel="prev" title="Building Android binary" href="building-android-binary.html"/>
@ -100,30 +100,33 @@
<li class="toctree-l1"><a class="reference internal" href="nghttp.1.html">nghttp(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpd.1.html">nghttpd(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpx.1.html">nghttpx(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#files">FILES</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#signals">SIGNALS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#server-push">SERVER PUSH</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#unix-domain-socket">UNIX DOMAIN SOCKET</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load.1.html">h2load(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#output">OUTPUT</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
@ -139,7 +142,7 @@
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#rewriting-location-header-field">Rewriting location header field</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#hot-swapping">Hot swapping</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#re-opening-log-files">Re-opening log files</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-http-1-backend-addresses">Multiple HTTP/1 backend addresses</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-backend-addresses">Multiple backend addresses</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load-howto.html">h2load - HTTP/2 benchmarking tool - HOW-TO</a><ul>
@ -153,6 +156,7 @@
<li class="toctree-l1"><a class="reference internal" href="apiref.html">API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#includes">Includes</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#remarks">Remarks</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#http-messaging">HTTP Messaging</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#macros">Macros</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#enums">Enums</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#types-structs-unions-and-typedefs">Types (structs, unions and typedefs)</a></li>
@ -161,6 +165,7 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="libnghttp2_asio.html">libnghttp2_asio: High level HTTP/2 C++ library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#server-api">Server API</a></li>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#client-api">Client API</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="python-apiref.html">Python API Reference</a><ul>
@ -170,6 +175,8 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2.h.html">nghttp2.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2ver.h.html">nghttp2ver.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_server.h.html">asio_http2_server.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_client.h.html">asio_http2_client.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2.h.html">asio_http2.h</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2">Source</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2/issues">Issues</a></li>
@ -1235,7 +1242,7 @@ here.</p>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.7.2-DEV',
VERSION:'0.7.8-DEV',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: false

View File

@ -7,7 +7,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tutorial: HPACK API &mdash; nghttp2 0.7.2-DEV documentation</title>
<title>Tutorial: HPACK API &mdash; nghttp2 0.7.8-DEV documentation</title>
@ -28,7 +28,7 @@
<link rel="top" title="nghttp2 0.7.2-DEV documentation" href="index.html"/>
<link rel="top" title="nghttp2 0.7.8-DEV documentation" href="index.html"/>
<link rel="next" title="nghttp(1)" href="nghttp.1.html"/>
<link rel="prev" title="Tutorial: HTTP/2 server" href="tutorial-server.html"/>
@ -100,30 +100,33 @@
<li class="toctree-l1"><a class="reference internal" href="nghttp.1.html">nghttp(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpd.1.html">nghttpd(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpx.1.html">nghttpx(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#files">FILES</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#signals">SIGNALS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#server-push">SERVER PUSH</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#unix-domain-socket">UNIX DOMAIN SOCKET</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load.1.html">h2load(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#output">OUTPUT</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
@ -139,7 +142,7 @@
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#rewriting-location-header-field">Rewriting location header field</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#hot-swapping">Hot swapping</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#re-opening-log-files">Re-opening log files</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-http-1-backend-addresses">Multiple HTTP/1 backend addresses</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-backend-addresses">Multiple backend addresses</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load-howto.html">h2load - HTTP/2 benchmarking tool - HOW-TO</a><ul>
@ -153,6 +156,7 @@
<li class="toctree-l1"><a class="reference internal" href="apiref.html">API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#includes">Includes</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#remarks">Remarks</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#http-messaging">HTTP Messaging</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#macros">Macros</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#enums">Enums</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#types-structs-unions-and-typedefs">Types (structs, unions and typedefs)</a></li>
@ -161,6 +165,7 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="libnghttp2_asio.html">libnghttp2_asio: High level HTTP/2 C++ library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#server-api">Server API</a></li>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#client-api">Client API</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="python-apiref.html">Python API Reference</a><ul>
@ -170,6 +175,8 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2.h.html">nghttp2.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2ver.h.html">nghttp2ver.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_server.h.html">asio_http2_server.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_client.h.html">asio_http2_client.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2.h.html">asio_http2.h</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2">Source</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2/issues">Issues</a></li>
@ -562,7 +569,7 @@ function.</p>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.7.2-DEV',
VERSION:'0.7.8-DEV',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: false

View File

@ -7,7 +7,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tutorial: HTTP/2 server &mdash; nghttp2 0.7.2-DEV documentation</title>
<title>Tutorial: HTTP/2 server &mdash; nghttp2 0.7.8-DEV documentation</title>
@ -28,7 +28,7 @@
<link rel="top" title="nghttp2 0.7.2-DEV documentation" href="index.html"/>
<link rel="top" title="nghttp2 0.7.8-DEV documentation" href="index.html"/>
<link rel="next" title="Tutorial: HPACK API" href="tutorial-hpack.html"/>
<link rel="prev" title="Tutorial: HTTP/2 client" href="tutorial-client.html"/>
@ -100,30 +100,33 @@
<li class="toctree-l1"><a class="reference internal" href="nghttp.1.html">nghttp(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttp.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpd.1.html">nghttpd(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpd.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttpx.1.html">nghttpx(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#files">FILES</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#signals">SIGNALS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#server-push">SERVER PUSH</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#unix-domain-socket">UNIX DOMAIN SOCKET</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load.1.html">h2load(1)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#synopsis">SYNOPSIS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#description">DESCRIPTION</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS:</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#options">OPTIONS</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#output">OUTPUT</a></li>
<li class="toctree-l2"><a class="reference internal" href="h2load.1.html#see-also">SEE ALSO</a></li>
</ul>
</li>
@ -139,7 +142,7 @@
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#rewriting-location-header-field">Rewriting location header field</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#hot-swapping">Hot swapping</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#re-opening-log-files">Re-opening log files</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-http-1-backend-addresses">Multiple HTTP/1 backend addresses</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#multiple-backend-addresses">Multiple backend addresses</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="h2load-howto.html">h2load - HTTP/2 benchmarking tool - HOW-TO</a><ul>
@ -153,6 +156,7 @@
<li class="toctree-l1"><a class="reference internal" href="apiref.html">API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#includes">Includes</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#remarks">Remarks</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#http-messaging">HTTP Messaging</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#macros">Macros</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#enums">Enums</a></li>
<li class="toctree-l2"><a class="reference internal" href="apiref.html#types-structs-unions-and-typedefs">Types (structs, unions and typedefs)</a></li>
@ -161,6 +165,7 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="libnghttp2_asio.html">libnghttp2_asio: High level HTTP/2 C++ library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#server-api">Server API</a></li>
<li class="toctree-l2"><a class="reference internal" href="libnghttp2_asio.html#client-api">Client API</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="python-apiref.html">Python API Reference</a><ul>
@ -170,6 +175,8 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2.h.html">nghttp2.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2ver.h.html">nghttp2ver.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_server.h.html">asio_http2_server.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2_client.h.html">asio_http2_client.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="asio_http2.h.html">asio_http2.h</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2">Source</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2/issues">Issues</a></li>
@ -1529,7 +1536,7 @@ is about to close and we no longer use that object.</p>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.7.2-DEV',
VERSION:'0.7.8-DEV',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: false