|
Nuria Framework - Network
Network module of the NuriaProject Framework
|
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>
Public Member Functions | |
| HttpServer (bool supportSsl=true, QObject *parent=0) | |
| ~HttpServer () | |
| HttpNode * | root () 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 |
The HttpServer class provides a simple HTTP server. This server is directed at providing interactive content, but it also may serve static content.
| Nuria::HttpServer::HttpServer | ( | bool | supportSsl = true, |
| QObject * | parent = 0 |
||
| ) |
Constructor. If you pass false for supportSsl, the HTTP server won't support SSL connections.
| Nuria::HttpServer::~HttpServer | ( | ) |
Destructor.
| const QString& Nuria::HttpServer::fqdn | ( | ) | const |
Returns the fully-qualified domain name of this server.
| 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.
true for the supportSsl parameter in the constructor! | QSslCertificate Nuria::HttpServer::localCertificate | ( | ) | const |
Returns the local SSL certificate.
| 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.
| 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.
| void Nuria::HttpServer::setPrivateKey | ( | const QSslKey & | key | ) |
Sets the SSL private key. Needed if you want to use SSL encryption.
| 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.
1.8.7