• WebServer
  • WebServer Class

    (nymeaserver::WebServer)

    This class represents the web server for nymead. More...

    Header: #include <WebServer>

    Public Functions

    nymeaserver::WebServerConfiguration configuration() const
    void setServerName(const int &serverName)
    bool startServer()
    bool stopServer()

    Protected Functions

    void clientConnected(const int &clientId)
    void clientDisconnected(const int &clientId)
    void incomingConnection(int socketDescriptor) override

    Protected Variables

    int

    Detailed Description

    This class represents the web server for nymead.

    The WebServer class provides a HTTP/1.1 web server. The web server provides access to the nymea-webinterface and the path can be specified in the /etc/nymea/nymead.conf file and to the nymea REST API. The default port for the web server is 3333, which is according to this list officially free.

    The URL for the insecure nymea-webinterface access:

    The URL for the secure HTTPS (TLS 1.2) nymea-webinterface access:
    \code https://localhost:3333

    The URL for the insecure REST API access to a RestResource:

    The URL for the secure HTTPS (TLS 1.2) REST API access to a \l{RestResource}:
    \code https://localhost:3333/api/v1/{RestResource}

    You can turn on the HTTPS server in the WebServer section of the /etc/nymea/nymead.conf file.

    Note: For HTTPS you need to have a certificate and configure it in the SSL-configuration section of the /etc/nymea/nymead.conf file.

    See also WebServerClient, WebSocketServer, and TcpServer.

    Member Function Documentation

    [protected] void WebServer::clientConnected(const int &clientId)

    [protected] void WebServer::clientDisconnected(const int &clientId)

    nymeaserver::WebServerConfiguration WebServer::configuration() const

    [protected] void WebServer::incomingConnection(int socketDescriptor)

    void WebServer::setServerName(const int &serverName)

    bool WebServer::startServer()

    bool WebServer::stopServer()