Nuria Framework - Network
Network module of the NuriaProject Framework
 All Classes Functions Typedefs Enumerations Enumerator
Public Member Functions | Friends | List of all members
Nuria::HttpServer Class Reference

The HttpServer class provides a simple HTTP server. This server is directed at providing interactive content, but it also may serve static content. More...

#include <httpserver.hpp>

Inheritance diagram for Nuria::HttpServer:

Public Member Functions

 HttpServer (bool supportSsl=true, QObject *parent=0)
 
 ~HttpServer ()
 
HttpNoderoot () const
 
void setRoot (HttpNode *node)
 
bool listen (const QHostAddress &interface=QHostAddress::Any, quint16 port=80)
 
bool listenSecure (const QHostAddress &interface=QHostAddress::Any, quint16 port=443)
 
QSslCertificate localCertificate () const
 
QSslKey privateKey () const
 
const QString & fqdn () const
 
void setLocalCertificate (const QSslCertificate &cert)
 
void setPrivateKey (const QSslKey &key)
 
int port () const
 
int securePort () const
 
void setFqdn (const QString &fqdn)
 

Friends

class HttpClient
 
class HttpNode
 

Detailed Description

The HttpServer class provides a simple HTTP server. This server is directed at providing interactive content, but it also may serve static content.

Constructor & Destructor Documentation

Nuria::HttpServer::HttpServer ( bool  supportSsl = true,
QObject *  parent = 0 
)

Constructor. If you pass false for supportSsl, the HTTP server won't support SSL connections.

See also
listen listenSecure
Nuria::HttpServer::~HttpServer ( )

Destructor.

Member Function Documentation

const QString& Nuria::HttpServer::fqdn ( ) const

Returns the fully-qualified domain name of this server.

See also
setFqdn
bool Nuria::HttpServer::listen ( const QHostAddress &  interface = QHostAddress::Any,
quint16  port = 80 
)

Starts the HTTP server. Returns true on success.

bool Nuria::HttpServer::listenSecure ( const QHostAddress &  interface = QHostAddress::Any,
quint16  port = 443 
)

Lets the HTTP server listen on a SSL encrypted port. Returns on success.

Note
For this to work you have to pass true for the supportSsl parameter in the constructor!
QSslCertificate Nuria::HttpServer::localCertificate ( ) const

Returns the local SSL certificate.

See also
setLocalCertificate
int Nuria::HttpServer::port ( ) const

Returns the HTTP port the server is listening on. If the server isn't listening -1 is returned.

QSslKey Nuria::HttpServer::privateKey ( ) const

Returns the SSL private key.

See also
setPrivateKey
HttpNode* Nuria::HttpServer::root ( ) const

Returns the root node.

int Nuria::HttpServer::securePort ( ) const

Returns the HTTPS port the server is listening on. If the server isn't listening -1 is returned.

void Nuria::HttpServer::setFqdn ( const QString &  fqdn)

Sets the fully-qualified domain name of this server. The server will fall-back using the 'Host' header value from clients if no value is set (default).

void Nuria::HttpServer::setLocalCertificate ( const QSslCertificate &  cert)

Sets the local SSL certificate. Needed if you want to use SSL encryption.

See also
setPrivateKey
void Nuria::HttpServer::setPrivateKey ( const QSslKey &  key)

Sets the SSL private key. Needed if you want to use SSL encryption.

See also
setLocalCertificate
void Nuria::HttpServer::setRoot ( HttpNode node)

Replaces the current root node with node. The old root node will be deleted. HttpServer will take ownership of node.


The documentation for this class was generated from the following file: