8#include <initializer_list>
13USERVER_NAMESPACE_BEGIN
26class SimpleServer
final {
35 std::string data_to_send{};
36 Commands command{kWriteAndClose};
39 using Request = std::string;
40 using OnRequest = std::function<
Response(
const Request&)>;
42 using Port =
unsigned short;
43 enum Protocol { kTcpIpV4, kTcpIpV6 };
45 SimpleServer(OnRequest callback, Protocol protocol = kTcpIpV4);
55 std::string GetBaseUrl(Schema type = Schema::kHttp)
const;
57 std::uint64_t GetConnectionsOpenedCount()
const;
61 const std::unique_ptr<Impl> pimpl_;