OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // A binary wrapper for QuicClient. | 5 // A binary wrapper for QuicClient. |
6 // Connects to a host using QUIC, sends a request to the provided URL, and | 6 // Connects to a host using QUIC, sends a request to the provided URL, and |
7 // displays the response. | 7 // displays the response. |
8 // | 8 // |
9 // Some usage examples: | 9 // Some usage examples: |
10 // | 10 // |
11 // TODO(rtenneti): make --host optional by getting IP Address of URL's host. | 11 // TODO(rtenneti): make --host optional by getting IP Address of URL's host. |
12 // | 12 // |
13 // Get IP address of the www.google.com | 13 // Get IP address of the www.google.com |
14 // IP=`dig www.google.com +short | head -1` | 14 // IP=`dig www.google.com +short | head -1` |
15 // | 15 // |
16 // Standard request/response: | 16 // Standard request/response: |
17 // quic_client http://www.google.com --host=${IP} | 17 // quic_client http://www.google.com --host=${IP} |
18 // quic_client http://www.google.com --quiet --host=${IP} | 18 // quic_client http://www.google.com --quiet --host=${IP} |
19 // quic_client https://www.google.com --port=443 --host=${IP} | 19 // quic_client https://www.google.com --port=443 --host=${IP} |
20 // | 20 // |
21 // Use a specific version: | 21 // Use a specific version: |
22 // quic_client http://www.google.com --version=23 --host=${IP} | 22 // quic_client http://www.google.com --quic_version=23 --host=${IP} |
Ryan Hamilton
2015/11/10 21:33:13
Can you updated quic_simple_client_bin.cc too?
Fe
| |
23 // | 23 // |
24 // Send a POST instead of a GET: | 24 // Send a POST instead of a GET: |
25 // quic_client http://www.google.com --body="this is a POST body" --host=${IP} | 25 // quic_client http://www.google.com --body="this is a POST body" --host=${IP} |
26 // | 26 // |
27 // Append additional headers to the request: | 27 // Append additional headers to the request: |
28 // quic_client http://www.google.com --host=${IP} | 28 // quic_client http://www.google.com --host=${IP} |
29 // --headers="Header-A: 1234; Header-B: 5678" | 29 // --headers="Header-A: 1234; Header-B: 5678" |
30 // | 30 // |
31 // Connect to a host different to the URL being requested: | 31 // Connect to a host different to the URL being requested: |
32 // Get IP address of the www.google.com | 32 // Get IP address of the www.google.com |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
299 return 0; | 299 return 0; |
300 } else { | 300 } else { |
301 cout << "Request failed (redirect " << response_code << ")." << endl; | 301 cout << "Request failed (redirect " << response_code << ")." << endl; |
302 return 1; | 302 return 1; |
303 } | 303 } |
304 } else { | 304 } else { |
305 cerr << "Request failed (" << response_code << ")." << endl; | 305 cerr << "Request failed (" << response_code << ")." << endl; |
306 return 1; | 306 return 1; |
307 } | 307 } |
308 } | 308 } |
OLD | NEW |