#include "httplib.hpp"
|
| Server () |
|
virtual | ~Server () |
|
int | bind_to_any_port (const char *host, int socket_flags=0) |
|
bool | bind_to_port (const char *host, int port, int socket_flags=0) |
|
Server & | Delete (const char *pattern, Handler handler) |
|
Server & | Get (const char *pattern, Handler handler) |
|
bool | is_running () const |
|
virtual bool | is_valid () const |
|
bool | listen (const char *host, int port, int socket_flags=0) |
|
bool | listen_after_bind () |
|
Server & | Options (const char *pattern, Handler handler) |
|
Server & | Patch (const char *pattern, Handler handler) |
|
Server & | Patch (const char *pattern, HandlerWithContentReader handler) |
|
Server & | Post (const char *pattern, Handler handler) |
|
Server & | Post (const char *pattern, HandlerWithContentReader handler) |
|
Server & | Put (const char *pattern, Handler handler) |
|
Server & | Put (const char *pattern, HandlerWithContentReader handler) |
|
bool | set_base_dir (const char *dir, const char *mount_point=nullptr) |
|
void | set_error_handler (Handler handler) |
|
void | set_file_request_handler (Handler handler) |
|
void | set_keep_alive_max_count (size_t count) |
|
void | set_logger (Logger logger) |
|
void | set_payload_max_length (size_t length) |
|
void | set_read_timeout (time_t sec, time_t usec) |
|
void | stop () |
|
|
int | bind_internal (const char *host, int port, int socket_flags) |
|
socket_t | create_server_socket (const char *host, int port, int socket_flags) const |
|
bool | dispatch_request (Request &req, Response &res, Handlers &handlers) |
|
bool | dispatch_request_for_content_reader (Request &req, Response &res, ContentReader content_reader, HandersForContentReader &handlers) |
|
bool | handle_file_request (Request &req, Response &res) |
|
bool | listen_internal () |
|
bool | parse_request_line (const char *s, Request &req) |
|
virtual bool | process_and_close_socket (socket_t sock) |
|
bool | read_content (Stream &strm, bool last_connection, Request &req, Response &res) |
|
bool | read_content_with_content_receiver (Stream &strm, bool last_connection, Request &req, Response &res, ContentReceiver reveiver) |
|
bool | routing (Request &req, Response &res, Stream &strm, bool last_connection) |
|
bool | write_content_with_provider (Stream &strm, const Request &req, Response &res, const std::string &boundary, const std::string &content_type) |
|
bool | write_response (Stream &strm, bool last_connection, const Request &req, Response &res) |
|
◆ HandersForContentReader
◆ Handler
◆ Handlers
◆ HandlerWithContentReader
◆ Logger
◆ Server()
httplib::Server::Server |
( |
| ) |
|
|
inline |
◆ ~Server()
httplib::Server::~Server |
( |
| ) |
|
|
inlinevirtual |
◆ bind_internal()
int httplib::Server::bind_internal |
( |
const char * |
host, |
|
|
int |
port, |
|
|
int |
socket_flags |
|
) |
| |
|
inlineprivate |
◆ bind_to_any_port()
int httplib::Server::bind_to_any_port |
( |
const char * |
host, |
|
|
int |
socket_flags = 0 |
|
) |
| |
|
inline |
◆ bind_to_port()
bool httplib::Server::bind_to_port |
( |
const char * |
host, |
|
|
int |
port, |
|
|
int |
socket_flags = 0 |
|
) |
| |
|
inline |
◆ create_server_socket()
socket_t httplib::Server::create_server_socket |
( |
const char * |
host, |
|
|
int |
port, |
|
|
int |
socket_flags |
|
) |
| const |
|
inlineprivate |
◆ Delete()
Server & httplib::Server::Delete |
( |
const char * |
pattern, |
|
|
Handler |
handler |
|
) |
| |
|
inline |
◆ dispatch_request()
◆ dispatch_request_for_content_reader()
◆ Get()
Server & httplib::Server::Get |
( |
const char * |
pattern, |
|
|
Handler |
handler |
|
) |
| |
|
inline |
◆ handle_file_request()
bool httplib::Server::handle_file_request |
( |
Request & |
req, |
|
|
Response & |
res |
|
) |
| |
|
inlineprivate |
◆ is_running()
bool httplib::Server::is_running |
( |
| ) |
const |
|
inline |
◆ is_valid()
bool httplib::Server::is_valid |
( |
| ) |
const |
|
inlinevirtual |
◆ listen()
bool httplib::Server::listen |
( |
const char * |
host, |
|
|
int |
port, |
|
|
int |
socket_flags = 0 |
|
) |
| |
|
inline |
◆ listen_after_bind()
bool httplib::Server::listen_after_bind |
( |
| ) |
|
|
inline |
◆ listen_internal()
bool httplib::Server::listen_internal |
( |
| ) |
|
|
inlineprivate |
◆ Options()
Server & httplib::Server::Options |
( |
const char * |
pattern, |
|
|
Handler |
handler |
|
) |
| |
|
inline |
◆ parse_request_line()
bool httplib::Server::parse_request_line |
( |
const char * |
s, |
|
|
Request & |
req |
|
) |
| |
|
inlineprivate |
◆ Patch() [1/2]
Server & httplib::Server::Patch |
( |
const char * |
pattern, |
|
|
Handler |
handler |
|
) |
| |
|
inline |
◆ Patch() [2/2]
◆ Post() [1/2]
Server & httplib::Server::Post |
( |
const char * |
pattern, |
|
|
Handler |
handler |
|
) |
| |
|
inline |
◆ Post() [2/2]
◆ process_and_close_socket()
bool httplib::Server::process_and_close_socket |
( |
socket_t |
sock | ) |
|
|
inlineprivatevirtual |
◆ process_request()
bool httplib::Server::process_request |
( |
Stream & |
strm, |
|
|
bool |
last_connection, |
|
|
bool & |
connection_close, |
|
|
const std::function< void(Request &)> & |
setup_request |
|
) |
| |
|
inlineprotected |
◆ Put() [1/2]
Server & httplib::Server::Put |
( |
const char * |
pattern, |
|
|
Handler |
handler |
|
) |
| |
|
inline |
◆ Put() [2/2]
◆ read_content()
bool httplib::Server::read_content |
( |
Stream & |
strm, |
|
|
bool |
last_connection, |
|
|
Request & |
req, |
|
|
Response & |
res |
|
) |
| |
|
inlineprivate |
◆ read_content_with_content_receiver()
◆ routing()
◆ set_base_dir()
bool httplib::Server::set_base_dir |
( |
const char * |
dir, |
|
|
const char * |
mount_point = nullptr |
|
) |
| |
|
inline |
◆ set_error_handler()
void httplib::Server::set_error_handler |
( |
Handler |
handler | ) |
|
|
inline |
◆ set_file_request_handler()
void httplib::Server::set_file_request_handler |
( |
Handler |
handler | ) |
|
|
inline |
◆ set_keep_alive_max_count()
void httplib::Server::set_keep_alive_max_count |
( |
size_t |
count | ) |
|
|
inline |
◆ set_logger()
void httplib::Server::set_logger |
( |
Logger |
logger | ) |
|
|
inline |
◆ set_payload_max_length()
void httplib::Server::set_payload_max_length |
( |
size_t |
length | ) |
|
|
inline |
◆ set_read_timeout()
void httplib::Server::set_read_timeout |
( |
time_t |
sec, |
|
|
time_t |
usec |
|
) |
| |
|
inline |
◆ stop()
void httplib::Server::stop |
( |
| ) |
|
|
inline |
◆ write_content_with_provider()
bool httplib::Server::write_content_with_provider |
( |
Stream & |
strm, |
|
|
const Request & |
req, |
|
|
Response & |
res, |
|
|
const std::string & |
boundary, |
|
|
const std::string & |
content_type |
|
) |
| |
|
inlineprivate |
◆ write_response()
bool httplib::Server::write_response |
( |
Stream & |
strm, |
|
|
bool |
last_connection, |
|
|
const Request & |
req, |
|
|
Response & |
res |
|
) |
| |
|
inlineprivate |
◆ base_dirs_
std::vector<std::pair<std::string, std::string> > httplib::Server::base_dirs_ |
|
private |
◆ delete_handlers_
Handlers httplib::Server::delete_handlers_ |
|
private |
◆ error_handler_
Handler httplib::Server::error_handler_ |
|
private |
◆ file_request_handler_
Handler httplib::Server::file_request_handler_ |
|
private |
◆ get_handlers_
◆ is_running_
std::atomic<bool> httplib::Server::is_running_ |
|
private |
◆ keep_alive_max_count_
size_t httplib::Server::keep_alive_max_count_ |
|
protected |
◆ logger_
Logger httplib::Server::logger_ |
|
private |
◆ new_task_queue
std::function<TaskQueue *(void)> httplib::Server::new_task_queue |
◆ options_handlers_
Handlers httplib::Server::options_handlers_ |
|
private |
◆ patch_handlers_
Handlers httplib::Server::patch_handlers_ |
|
private |
◆ patch_handlers_for_content_reader
◆ payload_max_length_
size_t httplib::Server::payload_max_length_ |
|
protected |
◆ post_handlers_
Handlers httplib::Server::post_handlers_ |
|
private |
◆ post_handlers_for_content_reader
◆ put_handlers_
◆ put_handlers_for_content_reader
◆ read_timeout_sec_
time_t httplib::Server::read_timeout_sec_ |
|
protected |
◆ read_timeout_usec_
time_t httplib::Server::read_timeout_usec_ |
|
protected |
◆ svr_sock_
std::atomic<socket_t> httplib::Server::svr_sock_ |
|
private |
The documentation for this class was generated from the following file: