proxygen
HTTPServerOptions.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-present, Facebook, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree. An additional grant
7  * of patent rights can be found in the PATENTS file in the same directory.
8  *
9  */
10 #pragma once
11 
12 #include <folly/Function.h>
13 #include <folly/SocketAddress.h>
17 #include <signal.h>
18 
19 namespace proxygen {
20 
28  public:
34  using NewConnectionFilter =
35  folly::Function<void(const folly::AsyncTransportWrapper* /* sock */,
36  const folly::SocketAddress* /* address */,
37  const std::string& /* nextProtocolName */,
38  SecureTransportType /* secureTransportType */,
39  const wangle::TransportInfo& /* tinfo */) const>;
40 
50  size_t threads = 1;
51 
66 
77  std::chrono::milliseconds idleTimeout{60000};
78 
83 
87  bool h2cEnabled{false};
88 
95  std::vector<int> shutdownOn{};
96 
101  bool supportsConnect{false};
102 
106  size_t initialReceiveWindow{65536};
107  size_t receiveStreamWindowSize{65536};
109 
115 
121 
126 
132 
136  bool enableExHeaders{false};
137 
141  std::set<std::string> contentCompressionTypes = {
142  "application/javascript",
143  "application/json",
144  "application/x-javascript",
145  "application/xhtml+xml",
146  "application/xml",
147  "application/xml+rss",
148  "text/css",
149  "text/html",
150  "text/javascript",
151  "text/plain",
152  "text/xml",
153  };
154 
159  std::vector<folly::AsyncServerSocket::UniquePtr> preboundSockets_;
160 
167  preboundSockets_.push_back(std::move(socket));
168  }
169 
170  void useExistingSocket(int socketFd) {
171  useExistingSockets({socketFd});
172  }
173 
174  void useExistingSockets(const std::vector<int>& socketFds) {
176 
177  socket->useExistingSockets(socketFds);
178  useExistingSocket(std::move(socket));
179  }
180 
186 };
187 }
chrono
Definition: CMakeCache.txt:563
void useExistingSocket(folly::AsyncServerSocket::UniquePtr socket)
std::chrono::milliseconds idleTimeout
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
STL namespace.
void useExistingSocket(int socketFd)
NewConnectionFilter newConnectionFilter
std::set< std::string > contentCompressionTypes
std::vector< std::unique_ptr< RequestHandlerFactory > > handlerFactories
void useExistingSockets(const std::vector< int > &socketFds)
Definition: Traits.h:588
NetworkSocket socket(int af, int type, int protocol)
Definition: NetOps.cpp:412
std::unique_ptr< AsyncServerSocket, Destructor > UniquePtr
const char * string
Definition: Conv.cpp:212
const
Definition: upload.py:398
std::vector< int > shutdownOn
std::vector< folly::AsyncServerSocket::UniquePtr > preboundSockets_