Yamato DaiwaBackend

"Server" Class

The main class of the framework providing the functionality for processing of the HTTP requests including the HTTPS protocol support.

Public Static Methods

initializeAndStart

(
):Server
Server.RawConfiguration
{
IP_Address
HTTP
HTTPS
}

Initializes the server application with the settings passed via single parameter, then starts this application. In the simplest case, the code will be similar to the following one:

initialize

(
):Server
Server.RawConfiguration
{
IP_Address
HTTP
HTTPS
}

Initializes the server application with the settings passed via single parameter, but does not start this application. It could be started later by the start, the non-static method.

Public Instance Methods

start

():Server

Launches the the instance of the server application represented by the instance of the Server class. This instance must be created preliminarily by the static method initialize:

Related Types

Server.RawConfig

Server.RawConfiguration
{
IP_Address
HTTP
HTTPS
}

Has an object type designed such as all that engineer must comprehend before starting the server application has been made required properties.

IP_Address

The required property; must contain the valid IP address, on which the incoming HTTP requests will be listened . In the simplest case with single request handler and wihtout HTTPS protocol support, the minimal example will be:

HTTP

RawConfig.HTTP
{
port
}

Specify this settings group if you are planning to support the HTTP protocol.

Currently, the only setting of this group is the HTTP port number (port property). To force the engineer to comprehend on which port the incoming HTTP requests will be listened, this property has been make required. If you are satisfied with default port for the HTTP protocol, use the ProtocolDependentDefaultPorts enumeration:

HTTPS

RawConfig.HTTPS
{
port
SSL_KeyFileRelativeOrAbsolutePath
SSL_Key
SSL_CertificateFileRelativeOrAbsolutePath
SSL_Certificate
}

Specify this settings group is you are planning to support the HTTPS protocol. According the modern security requirements, this protocol is exactly the one that should be used.

Currently, there are 5 properties among which there are 2 mutually exclusive pairs. Besides the HTTPS port number, it is required to specify the SSL certificate and SSL key, either via file path (relative or absolute, but the last one is more reliable) or via prepared strings representing the SSL certificate and SSL key. Below, the simplest examples for both cased represented.

Certainly, the SSH key and SSH certificate must be prepared before launching the application.