44 using namespace folly;
54 std::cout <<
"handling " << msg << std::endl;
55 write(ctx, msg +
"\r\n");
63 std::shared_ptr<AsyncTransportWrapper> sock)
override {
68 pipeline->addBack(EchoHandler());
76 void initCredProcessorCallbacks(
127 if (!FLAGS_tickets_path.empty()) {
136 if (!FLAGS_cert_path.empty() && !FLAGS_key_path.empty()) {
137 VLOG(0) <<
"Configuring SSL";
150 std::set<std::string> pathsToWatch { FLAGS_cert_path, FLAGS_key_path };
151 if (!FLAGS_ca_path.empty()) {
152 pathsToWatch.insert(FLAGS_ca_path);
157 initCredProcessorCallbacks(sb, processor);
161 std::make_shared<folly::IOThreadPoolExecutor>(FLAGS_num_workers);
std::vector< std::string > newSeeds
void setTicketPathToWatch(const std::string &ticketFile)
std::vector< std::string > currentSeeds
void write(const T &in, folly::io::Appender &appender)
static folly::Optional< wangle::TLSTicketKeySeeds > processTLSTickets(const std::string &fileName)
int main(int argc, char **argv)
virtual void setTLSTicketSecrets(const std::vector< std::string > &oldSecrets, const std::vector< std::string > ¤tSecrets, const std::vector< std::string > &newSecrets)
void bind(folly::AsyncServerSocket::UniquePtr s)
constexpr detail::Map< Move > move
DEFINE_uint32(num_workers, 2,"Number of worker threads")
—— Concurrent Priority Queue Implementation ——
ServerBootstrap * childPipeline(std::shared_ptr< PipelineFactory< Pipeline >> factory)
Pipeline< IOBufQueue &, std::string > EchoPipeline
bool allowInsecureConnectionsOnSecureServer
size_t read(T &out, folly::io::Cursor &cursor)
void addCertCallback(std::function< void()> callback)
bool runInEventBaseThread(void(*fn)(T *), T *arg)
ServerBootstrap * group(std::shared_ptr< folly::IOThreadPoolExecutor > io_group)
DEFINE_string(cert_path,"","Path to cert pem")
void setCertPathsToWatch(std::set< std::string > certFiles)
void forEachWorker(F &&f) const
void addCertificate(const std::string &certPath, const std::string &keyPath, const std::string &passwordPath)
TLSTicketKeySeeds initialTicketSeeds
std::shared_ptr< Pipeline > Ptr
std::vector< std::string > oldSeeds
ServerBootstrap * acceptorConfig(const ServerSocketConfig &accConfig)
virtual void resetSSLContextConfigs()
virtual folly::EventBase * getEventBase() const
std::vector< SSLContextConfig > sslContextConfigs
DEFINE_int32(port, 8080,"Listen port")
void addTicketCallback(std::function< void(wangle::TLSTicketKeySeeds)> callback)