1NGHTTP(1)                           nghttp2                          NGHTTP(1)
2
3
4

NAME

6       nghttp - HTTP/2 client
7

SYNOPSIS

9       nghttp [OPTIONS]... <URI>...
10

DESCRIPTION

12       HTTP/2 client
13
14       <URI>  Specify URI to access.
15

OPTIONS

17       -v, --verbose
18              Print    debug   information   such  as   reception   and trans‐
19              mission of frames and name/value pairs.  Specifying this  option
20              multiple times increases verbosity.
21
22       -n, --null-out
23              Discard downloaded data.
24
25       -O, --remote-name
26              Save   download   data  in  the  current  directory.   The file‐
27              name  is   derived  from   URI.   If   URI   ends    with   '/',
28              'index.html'  is used  as a  filename.  Not  implemented yet.
29
30       -t, --timeout=<DURATION>
31              Timeout  each  request after <DURATION>.  Set 0 to disable time‐
32              out.
33
34       -w, --window-bits=<N>
35              Sets the stream level initial window size to 2**<N>-1.
36
37       -W, --connection-window-bits=<N>
38              Sets   the   connection   level    initial   window   size    to
39              2**<N>-1.
40
41       -a, --get-assets
42              Download  assets   such as stylesheets, images  and script files
43              linked  from the downloaded resource.   Only links  whose   ori‐
44              gins  are   the  same   with the  linking resource will be down‐
45              loaded.   nghttp prioritizes resources using  HTTP/2  dependency
46              based  priority.   The   priority order, from highest to lowest,
47              is html itself, css, javascript and images.
48
49       -s, --stat
50              Print statistics.
51
52       -H, --header=<HEADER>
53              Add a header to the requests.  Example: -H':method: PUT'
54
55       --trailer=<HEADER>
56              Add a trailer header to the requests.  <HEADER> must not include
57              pseudo  header field  (header field name starting with ':').  To
58              send trailer, one must use  -d  option  to  send  request  body.
59              Example: --trailer 'foo: bar'.
60
61       --cert=<CERT>
62              Use  the specified  client certificate  file.  The  file must be
63              in PEM format.
64
65       --key=<KEY>
66              Use the  client private key  file.  The file  must   be  in  PEM
67              format.
68
69       -d, --data=<PATH>
70              Post  FILE  to  server. If '-'  is given, data will be read from
71              stdin.
72
73       -m, --multiply=<N>
74              Request each URI  <N>  times.   By  default,  same  URI  is  not
75              requested twice.  This option disables it too.
76
77       -u, --upgrade
78              Perform  HTTP Upgrade for HTTP/2.  This option is ignored if the
79              request URI has https scheme.  If -d is used, the  HTTP  upgrade
80              request is performed with OPTIONS method.
81
82       -p, --weight=<WEIGHT>
83              Sets   weight of  given  URI.  This  option  can be  used multi‐
84              ple times, and  N-th -p option sets  weight of N-th URI  in  the
85              command line.  If  the number of -p option is less than the num‐
86              ber of URI, the last -p option value is repeated.  If  there  is
87              no  -p  option, default weight, 16, is assumed.  The valid value
88              range is [1, 256], inclusive.
89
90       -M, --peer-max-concurrent-streams=<N>
91              Use  <N>  as  SETTINGS_MAX_CONCURRENT_STREAMS  value  of  remote
92              endpoint as if it  is received in SETTINGS frame.
93
94              Default: 100
95
96       -c, --header-table-size=<SIZE>
97              Specify  decoder   header  table  size.  If this  option is used
98              multiple times,  and the  minimum value  among the given  values
99              except   for  last  one  is  strictly less than the last  value,
100              that minimum  value is set  in SETTINGS frame   payload   before
101              the    last   value,   to   simulate  multiple header table size
102              change.
103
104       --encoder-header-table-size=<SIZE>
105              Specify encoder header table size.  The decoder (server)  speci‐
106              fies   the  maximum   dynamic table  size it  accepts.  Then the
107              negotiated dynamic table size is  the  minimum  of  this  option
108              value and the value which server specified.
109
110       -b, --padding=<N>
111              Add  at  most <N>  bytes to a  frame payload  as padding.  Spec‐
112              ify 0 to disable padding.
113
114       -r, --har=<PATH>
115              Output HTTP  transactions <PATH> in  HAR   format.   If  '-'  is
116              given, data is written to stdout.
117
118       --color
119              Force colored log output.
120
121       --continuation
122              Send large header to test CONTINUATION.
123
124       --no-content-length
125              Don't send content-length header field.
126
127       --no-dep
128              Don't send dependency based priority hint to server.
129
130       --hexdump
131              Display   the    incoming  traffic  in   hexadecimal  (Canonical
132              hex+ASCII display).  If SSL/TLS  is  used,  decrypted  data  are
133              used.
134
135       --no-push
136              Disable server push.
137
138       --max-concurrent-streams=<N>
139              The    number  of   concurrent   pushed   streams  this   client
140              accepts.
141
142       --expect-continue
143              Perform an Expect/Continue handshake:  wait to send DATA (up  to
144              a  short   timeout)   until  the  server  sends   a 100 Continue
145              interim response. This option is ignored  unless  combined  with
146              the -d option.
147
148       -y, --no-verify-peer
149              Suppress   warning   on  server  certificate  verification fail‐
150              ure.
151
152       --version
153              Display version information and exit.
154
155       -h, --help
156              Display this help and exit.
157
158       The <SIZE> argument is an integer and an optional unit (e.g., 10K is 10
159       * 1024).  Units are K, M and G (powers of 1024).
160
161       The <DURATION> argument is an integer and an optional unit (e.g., 1s is
162       1 second and 500ms is 500 milliseconds).  Units  are  h,  m,  s  or  ms
163       (hours, minutes, seconds and milliseconds, respectively).  If a unit is
164       omitted, a second is used as unit.
165

DEPENDENCY BASED PRIORITY

167       nghttp sends priority hints to server by  default  unless  --no-dep  is
168       used.   nghttp  mimics  the  way  Firefox employs to manages dependency
169       using idle streams.  We follows the behaviour of Firefox Nightly as  of
170       April, 2015, and nghttp's behaviour is very static and could be differ‐
171       ent from Firefox in detail.  But  reproducing  the  same  behaviour  of
172       Firefox  is not our goal.  The goal is provide the easy way to test out
173       the dependency priority in server implementation.
174
175       When connection is established, nghttp sends 5 PRIORITY frames to  idle
176       streams 3, 5, 7, 9 and 11 to create "anchor" nodes in dependency tree:
177
178                   +-----+
179                   |id=0 |
180                   +-----+
181                  ^   ^   ^
182           w=201 /    |    \ w=1
183                /     |     \
184               / w=101|      \
185           +-----+ +-----+ +-----+
186           |id=3 | |id=5 | |id=7 |
187           +-----+ +-----+ +-----+
188              ^               ^
189          w=1 |           w=1 |
190              |               |
191           +-----+         +-----+
192           |id=11|         |id=9 |
193           +-----+         +-----+
194
195       In  the  above  figure,  id  means  stream ID, and w means weight.  The
196       stream 0 is non-existence stream, and forms the root of the tree.   The
197       stream 7 and 9 are not used for now.
198
199       The  URIs given in the command-line depend on stream 11 with the weight
200       given in -p option, which defaults to 16.
201
202       If -a option is used, nghttp parses the resource pointed by  URI  given
203       in  command-line  as  html,  and extracts resource links from it.  When
204       requesting those resources, nghttp uses  dependency  according  to  its
205       resource type.
206
207       For  CSS,  and  Javascript  files inside "head" element, they depend on
208       stream 3 with the weight 2.  The Javascript files outside  "head"  ele‐
209       ment  depend on stream 5 with the weight 2.  The mages depend on stream
210       11 with the weight 12.  The other  resources  (e.g.,  icon)  depend  on
211       stream 11 with the weight 2.
212

SEE ALSO

214       nghttpd(1), nghttpx(1), h2load(1)
215

AUTHOR

217       Tatsuhiro Tsujikawa
218
220       2012, 2015, 2016, Tatsuhiro Tsujikawa
221
222
223
224
2251.39.0                           Jun 11, 2019                        NGHTTP(1)
Impressum