12#include <netinet/in.h>
34 const std::map<std::string, std::string>&
getErrorPages()
const;
49 void addErrorPage(
const std::string& errorCode,
const std::string& errorPagePath);
70 std::cout <<
"Default " <<
_serverName <<
" Listening on "
Stores per-route configuration directives. This class encapsulates the configuration for a specific l...
Parses and stores the entire HTTP request entity (headers, body). Utilizes a State Machine to handle ...
size_t getMaxBodySize() const
std::string getErrorPagePath(const std::string &errorCode) const
Retrieves the path to a custom error page if one exists.
const struct sockaddr_in & getInterfacePortPair() const
void setInterfacePortPair(const struct sockaddr_in &address)
std::vector< LocationConf > _locations
struct sockaddr_in _interfacePortPair
void addErrorPage(const std::string &errorCode, const std::string &errorPagePath)
Adds a custom error page mapping (e.g., "404" -> "/errors/404.html").
std::map< std::string, std::string > _errorPages
void addLocation(const LocationConf &location)
Adds a parsed LocationConf block to this server.
const std::vector< LocationConf > & getLocations() const
void setDefaults()
Set the Defaults config directives.
void setServerName(const std::string &name)
const std::string & getServerName() const
void setMaxBodySize(size_t size)
const std::map< std::string, std::string > & getErrorPages() const
ServerConf & operator=(const ServerConf &other)
std::string ipv4ToString(const struct ::sockaddr_in &addr)