51 gflags::ParseCommandLineFlags(&argc, &
argv,
true);
52 google::InitGoogleLogging(
argv[0]);
53 google::InstallFailureSignalHandler();
57 URL proxy(FLAGS_proxy);
59 if (FLAGS_http_method !=
"GET" && FLAGS_http_method !=
"POST") {
60 LOG(ERROR) <<
"http_method must be either GET or POST";
65 if (httpMethod == HTTPMethod::POST) {
67 File f(FLAGS_input_filename);
69 }
catch (
const std::system_error& se) {
70 LOG(ERROR) <<
"Couldn't open file for POST method";
71 LOG(ERROR) << se.what();
81 FLAGS_proxy.empty() ?
nullptr : &proxy,
88 if (!FLAGS_proxy.empty()) {
93 LOG(INFO) <<
"Trying to connect to " <<
addr;
99 std::chrono::milliseconds(HHWheelTimer::DEFAULT_TICK_INTERVAL),
100 AsyncTimeout::InternalEnum::NORMAL,
101 std::chrono::milliseconds(5000))};
103 if (!FLAGS_plaintext_proto.empty()) {
108 if (url.isSecure()) {
109 curlClient.initializeSsl(
110 FLAGS_ca_path, FLAGS_next_protos, FLAGS_cert_path, FLAGS_key_path);
111 connector.connectSSL(
114 curlClient.getSSLContext(),
116 std::chrono::milliseconds(FLAGS_http_client_connect_timeout),
119 curlClient.getServerName());
121 connector.connect(&evb, addr,
122 std::chrono::milliseconds(FLAGS_http_client_connect_timeout), opts);
folly::Optional< HTTPMethod > stringToMethod(folly::StringPiece method)
void setFlowControlSettings(int32_t recvWindow)
std::map< OptionKey, int > OptionMap
static const folly::SocketAddress & anyAddress()
void setPlaintextProtocol(const std::string &plaintextProto)
std::unique_ptr< HHWheelTimer, Destructor > UniquePtr
ErrorCode parseHeaders(Cursor &cursor, const FrameHeader &header, folly::Optional< PriorityUpdate > &outPriority, std::unique_ptr< IOBuf > &outBuf) noexcept
ThreadPoolListHook * addr