CoreComponents 4.0.0
A Modern C++ Toolkit
Loading...
Searching...
No Matches
HttpServerConfig Class Reference

Configuration for the HTTP server. More...

#include <cc/HttpServerConfig>

Inheritance diagram for HttpServerConfig:

Public Member Functions

 HttpServerConfig ()=default
 Create a null HTTP server configuration.
 HttpServerConfig (const MetaObject &config)
 Load a HTTP server configuration from config.
 HttpServerConfig (const String &text)
 Load a HTTP server configuration by parsing text (YASON format).
void addDirectoryInstance (const String &path)
 Add an instance of the directory service serving files from path.
void addEchoInstance ()
 Add an instance of the echo service.
List< SocketAddressaddress () const
 List of socket addresses the server is listening on
bool forceSecureTransport () const
 Transport layer security is required
long securePort () const
 Configured TLS port.
String user () const
 Name of user to switch to for server operation.
String group () const
 Name of group to switch to for server operation.
String version () const
 HTTP server version string (server identification).
bool daemon () const
 Daemonize process on server startup.
String daemonName () const
String pidPath () const
 File path to use to store the process ID
long concurrency () const
 Number of parallel connections to serve simultanously.
long serviceWindow () const
long connectionLimit () const
 Maximum number of simultanous connections allowed from a single source.
double connectionTimeout () const
 Maximum time to wait for a request on a stale connection.
int connectionTimeoutMs () const
TlsServerOptions tlsOptions () const
 TLS options.
const HttpLoggingServiceInstanceerrorLoggingInstance () const
const HttpLoggingServiceInstanceaccessLoggingInstance () const
List< HttpServiceInstanceserviceInstances () const
 Configured HTTP service instances.
HttpServiceInstance selectService (const String &host, const String &uri="") const
Public Member Functions inherited from Object
 Object ()=default
 Create a null object.
 operator bool () const
 Check if this is a non-null object.
bool isNull () const
 Check if this is a null object.
int useCount () const
 Reference count.
template<class T>
bool is () const
 Check if this object is of type T.
template<class T>
as () const
 Cast this object to type T.
bool isWeak () const
 Check if the underlying object reference is weak.
bool operator== (const Object &other) const
 Equality operator.
std::strong_ordering operator<=> (const Object &other) const
 Ordering operator.

Static Public Member Functions

static MetaObject prototype ()
 HTTP server configuration prototype.
static MetaObject parse (const String &text)
 Parse HTTP sever configuration from text.

Additional Inherited Members

Public Types inherited from Object
using NullAccess = cc::NullAccess
 Error thrown when trying to access a null object.
using VirginityTestFailed = cc::VirginityTestFailed
 Error thrown when trying to initialize an object with a non-virgin state.
Protected Member Functions inherited from Object
template<class T>
weak () const
template<class T>
void initOnce ()
 Create the object state when called the first time.
template<class T>
void initOncePerThread ()
 Create a distinct object state for each thread when called the first time in that thread.
 Object (State *newState)
 Initialize object with newState.
 Object (State *state, Alias)
 Object (State *state, Weak)
Objectoperator= (std::nullptr_t)
Static Protected Member Functions inherited from Object
template<class T>
static T alias (const State *state)
 Create an alias object for the given state.
template<class T>
static T weak (const State *state)
Protected Attributes inherited from Object
Handle< Stateme
 Internal object state

Detailed Description

Configuration for the HTTP server.

Constructor & Destructor Documentation

◆ HttpServerConfig() [1/3]

HttpServerConfig ( )
default

Create a null HTTP server configuration.

◆ HttpServerConfig() [2/3]

HttpServerConfig ( const MetaObject & config)
explicit

Load a HTTP server configuration from config.

◆ HttpServerConfig() [3/3]

HttpServerConfig ( const String & text)
explicit

Load a HTTP server configuration by parsing text (YASON format).

Member Function Documentation

◆ prototype()

MetaObject prototype ( )
static

HTTP server configuration prototype.

◆ parse()

MetaObject parse ( const String & text)
static

Parse HTTP sever configuration from text.

◆ addDirectoryInstance()

void addDirectoryInstance ( const String & path)

Add an instance of the directory service serving files from path.

◆ addEchoInstance()

void addEchoInstance ( )

Add an instance of the echo service.

◆ address()

List< SocketAddress > address ( ) const

List of socket addresses the server is listening on

◆ forceSecureTransport()

bool forceSecureTransport ( ) const

Transport layer security is required

◆ securePort()

long securePort ( ) const

Configured TLS port.

◆ user()

String user ( ) const

Name of user to switch to for server operation.

◆ group()

String group ( ) const

Name of group to switch to for server operation.

◆ version()

String version ( ) const

HTTP server version string (server identification).

◆ daemon()

bool daemon ( ) const

Daemonize process on server startup.

◆ pidPath()

String pidPath ( ) const

File path to use to store the process ID

◆ concurrency()

long concurrency ( ) const

Number of parallel connections to serve simultanously.

◆ connectionLimit()

long connectionLimit ( ) const

Maximum number of simultanous connections allowed from a single source.

◆ connectionTimeout()

double connectionTimeout ( ) const

Maximum time to wait for a request on a stale connection.

◆ tlsOptions()

TlsServerOptions tlsOptions ( ) const

TLS options.

◆ serviceInstances()

List< HttpServiceInstance > serviceInstances ( ) const

Configured HTTP service instances.