1NGHTTP(1) nghttp2 NGHTTP(1)
2
3
4
6 nghttp - HTTP/2 client
7
9 nghttp [OPTIONS]... <URI>...
10
12 HTTP/2 client
13
14 <URI> Specify URI to access.
15
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 '/', 'in‐
28 dex.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. Ex‐
59 ample: --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 re‐
75 quested 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 ac‐
140 cepts.
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 in‐
145 terim response. This option is ignored unless combined with the
146 -d option.
147
148 -y, --no-verify-peer
149 Suppress warning on server certificate verification fail‐
150 ure.
151
152 --ktls Enable ktls.
153
154 --no-rfc7540-pri
155 Disable RFC7540 priorities.
156
157 --version
158 Display version information and exit.
159
160 -h, --help
161 Display this help and exit.
162
163 The <SIZE> argument is an integer and an optional unit (e.g., 10K is 10
164 * 1024). Units are K, M and G (powers of 1024).
165
166 The <DURATION> argument is an integer and an optional unit (e.g., 1s is
167 1 second and 500ms is 500 milliseconds). Units are h, m, s or ms
168 (hours, minutes, seconds and milliseconds, respectively). If a unit is
169 omitted, a second is used as unit.
170
172 nghttp sends priority hints to server by default unless --no-dep is
173 used. nghttp mimics the way Firefox employs to manages dependency us‐
174 ing idle streams. We follows the behaviour of Firefox Nightly as of
175 April, 2015, and nghttp's behaviour is very static and could be differ‐
176 ent from Firefox in detail. But reproducing the same behaviour of
177 Firefox is not our goal. The goal is provide the easy way to test out
178 the dependency priority in server implementation.
179
180 When connection is established, nghttp sends 5 PRIORITY frames to idle
181 streams 3, 5, 7, 9 and 11 to create "anchor" nodes in dependency tree:
182
183 +-----+
184 |id=0 |
185 +-----+
186 ^ ^ ^
187 w=201 / | \ w=1
188 / | \
189 / w=101| \
190 +-----+ +-----+ +-----+
191 |id=3 | |id=5 | |id=7 |
192 +-----+ +-----+ +-----+
193 ^ ^
194 w=1 | w=1 |
195 | |
196 +-----+ +-----+
197 |id=11| |id=9 |
198 +-----+ +-----+
199
200 In the above figure, id means stream ID, and w means weight. The
201 stream 0 is non-existence stream, and forms the root of the tree. The
202 stream 7 and 9 are not used for now.
203
204 The URIs given in the command-line depend on stream 11 with the weight
205 given in -p option, which defaults to 16.
206
207 If -a option is used, nghttp parses the resource pointed by URI given
208 in command-line as html, and extracts resource links from it. When re‐
209 questing those resources, nghttp uses dependency according to its re‐
210 source type.
211
212 For CSS, and Javascript files inside "head" element, they depend on
213 stream 3 with the weight 2. The Javascript files outside "head" ele‐
214 ment depend on stream 5 with the weight 2. The mages depend on stream
215 11 with the weight 12. The other resources (e.g., icon) depend on
216 stream 11 with the weight 2.
217
219 nghttpd(1), nghttpx(1), h2load(1)
220
222 Tatsuhiro Tsujikawa
223
225 2012, 2015, 2016, Tatsuhiro Tsujikawa
226
227
228
229
2301.55.1 Jul 14, 2023 NGHTTP(1)