tufao
1.3.0
An asynchronous web framework for C++ built on top of Qt
|
Tufao::HttpsServer is a subclass of Tufao::HttpServer that provides secure communication with the client. More...
Public Member Functions | |
HttpsServer (QObject *parent=0) | |
~HttpsServer () | |
Destroys the object. | |
void | setLocalCertificate (const QSslCertificate &certificate) |
Sets the local certificate to certificate . More... | |
void | setPrivateKey (const QSslKey &key) |
Sets the private key to key . More... | |
Public Member Functions inherited from Tufao::HttpServer | |
HttpServer (QObject *parent=0) | |
Constructs a Tufao::HttpServer object. More... | |
~HttpServer () | |
Destroys the object. | |
bool | listen (const QHostAddress &address=QHostAddress::Any, quint16 port=0) |
Tells the server to listen for incoming connections on address address and port port . More... | |
bool | isListening () const |
Returns true if the server is listening for incoming connections. | |
quint16 | serverPort () const |
Returns the server's port if the server is listening; otherwise returns 0. More... | |
void | setTimeout (int msecs=0) |
Sets the timeout of new connections to msecs miliseconds. More... | |
int | timeout () const |
Returns the current set timeout. | |
void | setUpgradeHandler (UpgradeHandler functor) |
This method sets the handler that will be called to handle http upgrade requests. More... | |
Protected Member Functions | |
void | incomingConnection (qintptr socketDescriptor) override |
Protected Member Functions inherited from Tufao::HttpServer | |
void | handleConnection (QAbstractSocket *connection) |
Call this function will make Tufao::HttpServer handle the connection connection . More... | |
virtual void | checkContinue (HttpServerRequest &request, HttpServerResponse &response) |
This virtual function is called by HttpServer when a client do a request with the HTTP header "Expect: 100-continue". More... | |
Additional Inherited Members | |
Public Types inherited from Tufao::HttpServer | |
typedef std::function< void(HttpServerRequest &request, const QByteArray &)> | UpgradeHandler |
A typedef to http upgrade request handler. More... | |
Public Slots inherited from Tufao::HttpServer | |
void | close () |
Closes the server. More... | |
Signals inherited from Tufao::HttpServer | |
void | requestReady (Tufao::HttpServerRequest &request, Tufao::HttpServerResponse &response) |
This signal is emitted each time there is request. More... | |
Static Public Member Functions inherited from Tufao::HttpServer | |
static UpgradeHandler | defaultUpgradeHandler () |
Returns the default http upgrade request's handler. More... | |
Tufao::HttpsServer is a subclass of Tufao::HttpServer that provides secure communication with the client.
It does this using socket streams over TLS connections.
This combination (HTTP + SSL/TLS) is know as HTTP Secure and provides encrypted communication.
To use HTTPS in Tufão, just set the local certficate and private key before call Tufao::HttpsServer::listen. The default port for this protocol is 443.
void Tufao::HttpsServer::setLocalCertificate | ( | const QSslCertificate & | certificate | ) |
Sets the local certificate to certificate
.
void Tufao::HttpsServer::setPrivateKey | ( | const QSslKey & | key | ) |
Sets the private key to key
.