// Copyright 2012 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // A binary wrapper for QuicClient. // Connects to a host using QUIC, sends a request to the provided URL, and // displays the response. // // Some usage examples: // // Standard request/response: // quic_client http://www.google.com // quic_client http://www.google.com --quiet // quic_client https://www.google.com --port=443 // // Use a specific version: // quic_client http://www.google.com --quic_version=23 // // Send a POST instead of a GET: // quic_client http://www.google.com --body="this is a POST body" // // Append additional headers to the request: // quic_client http://www.google.com --host=${IP} // --headers="Header-A: 1234; Header-B: 5678" // // Connect to a host different to the URL being requested: // quic_client mail.google.com --host=www.google.com // // Connect to a specific IP: // IP=`dig www.google.com +short | head -1` // quic_client www.google.com --host=${IP} // // Try to connect to a host which does not speak QUIC: // quic_client http://www.example.com #include "base/logging.h" #include "base/ranges/algorithm.h" #include "net/base/address_family.h" #include "net/base/net_errors.h" #include "net/quic/address_utils.h" #include "net/third_party/quiche/src/quiche/common/platform/api/quiche_command_line_flags.h" #include "net/third_party/quiche/src/quiche/common/platform/api/quiche_system_event_loop.h" #include "net/third_party/quiche/src/quiche/quic/core/quic_error_codes.h" #include "net/third_party/quiche/src/quiche/quic/core/quic_packets.h" #include "net/third_party/quiche/src/quiche/quic/core/quic_server_id.h" #include "net/third_party/quiche/src/quiche/quic/core/quic_versions.h" #include "net/third_party/quiche/src/quiche/quic/platform/api/quic_socket_address.h" #include "net/third_party/quiche/src/quiche/quic/tools/quic_toy_client.h" #include "net/tools/quic/quic_simple_client.h" #include "net/tools/quic/synchronous_host_resolver.h" #include "url/scheme_host_port.h" #include "url/url_constants.h" ProofVerifier; namespace { class QuicSimpleClientFactory : public quic::QuicToyClient::ClientFactory { … }; } // namespace int main(int argc, char* argv[]) { … }