proxygen
|
#include <ScopedHTTPServer.h>
Public Member Functions | |
int | getPort () const |
std::vector< HTTPServer::IPConfig > | getAddresses () const |
~ScopedHTTPServer () | |
Static Public Member Functions | |
template<typename HandlerType > | |
static std::unique_ptr< ScopedHTTPServer > | start (HandlerType handler, int port=0, int numThreads=4, std::unique_ptr< wangle::SSLContextConfig > sslCfg=nullptr) |
static std::unique_ptr< ScopedHTTPServer > | start (HTTPServer::IPConfig cfg, HTTPServerOptions options) |
Private Member Functions | |
ScopedHTTPServer (std::thread thread, std::unique_ptr< HTTPServer > server) | |
Private Attributes | |
std::thread | thread_ |
std::unique_ptr< HTTPServer > | server_ |
A basic server that can be used for testing http clients. Since most such servers are short lived, this server takes care of starting and stopping automatically.
Definition at line 88 of file ScopedHTTPServer.h.
|
inline |
Definition at line 124 of file ScopedHTTPServer.h.
|
inlineprivate |
Definition at line 130 of file ScopedHTTPServer.h.
|
inline |
Get the addresses for the server.
Definition at line 118 of file ScopedHTTPServer.h.
|
inline |
Get the port the server is listening on. This is helpful if the port was randomly chosen.
Definition at line 111 of file ScopedHTTPServer.h.
|
inlinestatic |
Start a server listening on the requested port
. If port
is 0, it will choose a random port.
Definition at line 141 of file ScopedHTTPServer.h.
References f, handler(), folly::gen::move, and start.
|
inlinestatic |
Start a server listening with the requested IPConfig and server opts
Definition at line 179 of file ScopedHTTPServer.h.
References folly::gen::move, folly::setThreadName(), and folly::pushmi::detail::t.
|
private |
Definition at line 137 of file ScopedHTTPServer.h.
|
private |
Definition at line 136 of file ScopedHTTPServer.h.