Server

struct Server

Public Functions

Server() = default
Server(Server&&) = delete
Server(Server const&) = delete
inline virtual ~Server()
virtual void close() = 0
virtual void send(Response const&) = 0
virtual void upgrade(Request const&) = 0
virtual void send_text(std::string_view const&) = 0

Public Static Functions

static std::unique_ptr<Server> create(Handler&, io::net::tcp::Connection::Factory&)
static std::unique_ptr<Server> create(Handler&, io::net::tcp::Connection::Factory&, Config const&)
struct Binary

Public Members

std::span<std::byte const> payload
struct Close

Public Members

std::string_view payload
struct Config

Public Members

size_t decode_buffer_size = {}
size_t encode_buffer_size = {}
http::Connection connection = {}
std::chrono::nanoseconds request_timeout = {}
std::string_view server
std::string_view access_control_allow_origin
std::string_view url_prefix
struct Disconnected
struct Handler

Public Functions

virtual void operator()(Disconnected const&) = 0
virtual void operator()(Request const&) = 0
inline virtual void operator()(Close const&)
virtual void operator()(Text const&) = 0
virtual void operator()(Binary const&) = 0
inline virtual void operator()(Latency const&)
struct Headers

Public Members

std::string_view user_agent
std::string_view x_forwarded_for
std::string_view x_real_ip
http::Connection connection = {}
std::string_view upgrade
std::string_view sec_websocket_key
http::Accept accept = {}
http::ContentType content_type = {}
struct Latency

Public Members

std::chrono::nanoseconds sample
struct Request

Public Members

http::Method method = {}
std::span<std::string_view> path
std::span<std::pair<std::string_view, std::string_view>> query
Headers headers
std::string_view body
struct Response

Public Members

http::Status status = {}
http::Connection connection = {}
std::string_view sec_websocket_accept
std::string_view cache_control
http::ContentType content_type = {}
std::string_view body
struct Text

Public Members

std::string_view payload