1#ifndef SSGXLIB_SSGX_HTTP_T_SERVER_H
2#define SSGXLIB_SSGX_HTTP_T_SERVER_H
6#include <unordered_map>
126 void Get(
const std::string& path,
138 void Post(
const std::string& path,
142 void RegisterHandler(
const std::string& method,
const std::string& path,
149 const std::string& method_path);
156 std::string server_id_;
157 uint64_t timeout_seconds_ = 60;
158 uint64_t max_threads_ = 4;
159 uint64_t max_queued_ = 64;
160 bool is_stopped_ =
true;
164 std::mutex key_handler_map_mutex_;
A class to manage a chain of filters for request processing.
Definition ssgx_http_t_filter.h:61
HTTP request class to represent an incoming HTTP request.
Definition ssgx_http_t_structs.h:109
HTTP response class to represent an outgoing HTTP response.
Definition ssgx_http_t_structs.h:424
HTTP service class for managing request listening and routing.
Definition ssgx_http_t_server.h:24
void Post(const std::string &path, const std::function< void(ssgx::http_t::Request &, ssgx::http_t::Response &)> &handler)
Register a handler for POST requests.
void SetTimeOut(uint64_t timeout_seconds)
Set the timeout duration for requests.
friend void ServerProcessBridge(Server *srv, const std::string &method, const std::string &path, ssgx::http_t::Request &req, ssgx::http_t::Response &resp)
bool Start()
Start the server to begin handling requests.
Server()=default
Default constructor.
void Stop()
Stop the server.
void SetMaxQueued(uint64_t max_queued)
Set the maximum number of queued connections.
void AddFilter(std::unique_ptr< Filter > &&filter)
Add a filter to the server's filter chain.
void SetMaxThreads(uint64_t max_threads)
Set the maximum number of allowed threads.
void Listen(const std::string &url)
Start listening on the specified URL.
void Get(const std::string &path, const std::function< void(ssgx::http_t::Request &, ssgx::http_t::Response &)> &handler)
Register a handler for GET requests.
Definition ssgx_attestation_t.h:6