nghttp2/doc/nghttp.1.rst

257 lines
7.3 KiB
ReStructuredText
Raw Normal View History

2015-05-12 17:44:37 +02:00
.. GENERATED by help2rst.py. DO NOT EDIT DIRECTLY.
2015-04-17 16:14:23 +02:00
.. program:: nghttp
nghttp(1)
=========
SYNOPSIS
--------
**nghttp** [OPTIONS]... <URI>...
DESCRIPTION
-----------
2015-10-19 17:22:03 +02:00
HTTP/2 client
.. describe:: <URI>
Specify URI to access.
2015-02-01 10:33:24 +01:00
OPTIONS
-------
.. option:: -v, --verbose
2015-01-15 16:10:16 +01:00
Print debug information such as reception and
transmission of frames and name/value pairs. Specifying
this option multiple times increases verbosity.
.. option:: -n, --null-out
Discard downloaded data.
.. option:: -O, --remote-name
2015-01-15 16:10:16 +01:00
Save download data in the current directory. The
2015-11-12 15:14:45 +01:00
filename is derived from URI. If URI ends with '*/*',
2015-01-15 16:10:16 +01:00
'index.html' is used as a filename. Not implemented
yet.
2015-05-07 13:55:10 +02:00
.. option:: -t, --timeout=<DURATION>
2015-05-07 13:55:10 +02:00
Timeout each request after <DURATION>. Set 0 to disable
timeout.
.. option:: -w, --window-bits=<N>
2015-01-15 16:10:16 +01:00
Sets the stream level initial window size to 2\*\*<N>-1.
.. option:: -W, --connection-window-bits=<N>
2015-01-15 16:10:16 +01:00
Sets the connection level initial window size to
2\*\*<N>-1.
.. option:: -a, --get-assets
2015-01-15 16:10:16 +01:00
Download assets such as stylesheets, images and script
files linked from the downloaded resource. Only links
whose origins are the same with the linking resource
will be downloaded. nghttp prioritizes resources using
HTTP/2 dependency based priority. The priority order,
from highest to lowest, is html itself, css, javascript
and images.
.. option:: -s, --stat
Print statistics.
2014-10-27 16:35:44 +01:00
.. option:: -H, --header=<HEADER>
2015-01-15 16:10:16 +01:00
Add a header to the requests. Example: :option:`-H`\':method: PUT'
2015-03-14 10:52:50 +01:00
.. option:: --trailer=<HEADER>
Add a trailer header to the requests. <HEADER> must not
include pseudo header field (header field name starting
with ':'). To send trailer, one must use :option:`-d` option to
send request body. Example: :option:`--trailer` 'foo: bar'.
.. option:: --cert=<CERT>
2015-01-15 16:10:16 +01:00
Use the specified client certificate file. The file
must be in PEM format.
.. option:: --key=<KEY>
2015-01-15 16:10:16 +01:00
Use the client private key file. The file must be in
PEM format.
2015-07-28 17:01:12 +02:00
.. option:: -d, --data=<PATH>
2015-01-15 16:10:16 +01:00
Post FILE to server. If '-' is given, data will be read
from stdin.
.. option:: -m, --multiply=<N>
2015-01-15 16:10:16 +01:00
Request each URI <N> times. By default, same URI is not
requested twice. This option disables it too.
.. option:: -u, --upgrade
2015-01-15 16:10:16 +01:00
Perform HTTP Upgrade for HTTP/2. This option is ignored
if the request URI has https scheme. If :option:`-d` is used, the
HTTP upgrade request is performed with OPTIONS method.
.. option:: -p, --weight=<WEIGHT>
2016-07-31 14:16:34 +02:00
Sets weight of given URI. This option can be used
multiple times, and N-th :option:`-p` option sets weight of N-th
URI in the command line. If the number of :option:`-p` option is
less than the number of URI, the last :option:`-p` option value is
repeated. If there is no :option:`-p` option, default weight, 16,
is assumed. The valid value range is
2015-01-15 16:10:16 +01:00
[1, 256], inclusive.
.. option:: -M, --peer-max-concurrent-streams=<N>
2015-01-15 16:10:16 +01:00
Use <N> as SETTINGS_MAX_CONCURRENT_STREAMS value of
remote endpoint as if it is received in SETTINGS frame.
Default: ``100``
2015-01-15 16:10:16 +01:00
.. option:: -c, --header-table-size=<SIZE>
2015-10-25 09:05:48 +01:00
Specify decoder header table size. If this option is
used multiple times, and the minimum value among the
given values except for last one is strictly less than
the last value, that minimum value is set in SETTINGS
frame payload before the last value, to simulate
multiple header table size change.
.. option:: -b, --padding=<N>
2015-01-15 16:10:16 +01:00
Add at most <N> bytes to a frame payload as padding.
Specify 0 to disable padding.
2015-07-28 17:01:12 +02:00
.. option:: -r, --har=<PATH>
2014-11-24 07:27:41 +01:00
2015-07-28 17:01:12 +02:00
Output HTTP transactions <PATH> in HAR format. If '-'
2015-01-15 16:10:16 +01:00
is given, data is written to stdout.
2014-11-24 07:27:41 +01:00
.. option:: --color
Force colored log output.
.. option:: --continuation
Send large header to test CONTINUATION.
.. option:: --no-content-length
Don't send content-length header field.
2014-11-24 07:27:41 +01:00
.. option:: --no-dep
2015-01-15 16:10:16 +01:00
Don't send dependency based priority hint to server.
2014-11-24 07:27:41 +01:00
2015-03-26 16:37:12 +01:00
.. option:: --hexdump
Display the incoming traffic in hexadecimal (Canonical
hex+ASCII display). If SSL/TLS is used, decrypted data
are used.
2015-04-19 11:10:54 +02:00
.. option:: --no-push
Disable server push.
2015-07-11 05:45:23 +02:00
.. option:: --max-concurrent-streams=<N>
The number of concurrent pushed streams this client
accepts.
2016-04-10 09:59:57 +02:00
.. option:: --expect-continue
Perform an Expect/Continue handshake: wait to send DATA
(up to a short timeout) until the server sends a 100
Continue interim response. This option is ignored unless
combined with the :option:`-d` option.
.. option:: --version
Display version information and exit.
.. option:: -h, --help
Display this help and exit.
2015-01-15 16:10:16 +01:00
2015-03-30 17:23:12 +02:00
2015-01-15 16:10:16 +01:00
The <SIZE> argument is an integer and an optional unit (e.g., 10K is
10 * 1024). Units are K, M and G (powers of 1024).
2015-05-07 13:55:10 +02:00
The <DURATION> argument is an integer and an optional unit (e.g., 1s
is 1 second and 500ms is 500 milliseconds). Units are h, m, s or ms
(hours, minutes, seconds and milliseconds, respectively). If a unit
is omitted, a second is used as unit.
2015-04-17 16:14:23 +02:00
DEPENDENCY BASED PRIORITY
-------------------------
nghttp sends priority hints to server by default unless
:option:`--no-dep` is used. nghttp mimics the way Firefox employs to
manages dependency using idle streams. We follows the behaviour of
Firefox Nightly as of April, 2015, and nghttp's behaviour is very
static and could be different from Firefox in detail. But reproducing
the same behaviour of Firefox is not our goal. The goal is provide
the easy way to test out the dependency priority in server
implementation.
When connection is established, nghttp sends 5 PRIORITY frames to idle
streams 3, 5, 7, 9 and 11 to create "anchor" nodes in dependency
2016-07-16 12:10:34 +02:00
tree:
.. code-block:: text
2015-04-17 16:14:23 +02:00
+-----+
|id=0 |
+-----+
^ ^ ^
w=201 / | \ w=1
/ | \
/ w=101| \
+-----+ +-----+ +-----+
|id=3 | |id=5 | |id=7 |
+-----+ +-----+ +-----+
^ ^
w=1 | w=1 |
| |
+-----+ +-----+
|id=11| |id=9 |
+-----+ +-----+
In the above figure, ``id`` means stream ID, and ``w`` means weight.
The stream 0 is non-existence stream, and forms the root of the tree.
The stream 7 and 9 are not used for now.
The URIs given in the command-line depend on stream 11 with the weight
given in :option:`-p` option, which defaults to 16.
If :option:`-a` option is used, nghttp parses the resource pointed by
URI given in command-line as html, and extracts resource links from
it. When requesting those resources, nghttp uses dependency according
to its resource type.
For CSS, and Javascript files inside "head" element, they depend on
stream 3 with the weight 2. The Javascript files outside "head"
element depend on stream 5 with the weight 2. The mages depend on
stream 11 with the weight 12. The other resources (e.g., icon) depend
on stream 11 with the weight 2.
SEE ALSO
--------
:manpage:`nghttpd(1)`, :manpage:`nghttpx(1)`, :manpage:`h2load(1)`