diff options
author | Kurt Pattyn <pattyn.kurt@gmail.com> | 2013-11-06 20:00:39 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-06 20:02:37 +0100 |
commit | 91f93d2781e494d7835385aa501667d71ae231e7 (patch) | |
tree | 5eb0055dd628942073c7291249e93542f84f899c /src/websockets/qwebsocketserver.h | |
parent | 529b9a7cc85f63966c8ed6150ea18286b7459b1e (diff) | |
download | qtwebsockets-91f93d2781e494d7835385aa501667d71ae231e7.tar.gz |
Add sslEchoClient and sslEchoServer examples
Add license headers
Change-Id: Ied74cb3db6ceed6c3f361e4afac860a7a3fb7676
Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
Diffstat (limited to 'src/websockets/qwebsocketserver.h')
-rw-r--r-- | src/websockets/qwebsocketserver.h | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/src/websockets/qwebsocketserver.h b/src/websockets/qwebsocketserver.h index a925fda..c616c0b 100644 --- a/src/websockets/qwebsocketserver.h +++ b/src/websockets/qwebsocketserver.h @@ -42,12 +42,17 @@ #ifndef QWEBSOCKETSERVER_H #define QWEBSOCKETSERVER_H +#include "QtWebSockets/qwebsockets_global.h" +#include "QtWebSockets/qwebsocketprotocol.h" + #include <QtCore/QObject> #include <QtCore/QString> #include <QtNetwork/QHostAddress> -#include "QtWebSockets/qwebsockets_global.h" -#include "QtWebSockets/qwebsocketprotocol.h" +#ifndef QT_NO_SSL +#include <QtNetwork/QSslConfiguration> +#include <QtNetwork/QSslError> +#endif QT_BEGIN_NAMESPACE @@ -61,8 +66,17 @@ class Q_WEBSOCKETS_EXPORT QWebSocketServer : public QObject Q_DISABLE_COPY(QWebSocketServer) Q_DECLARE_PRIVATE(QWebSocketServer) + Q_ENUMS(SecureMode) + public: - explicit QWebSocketServer(const QString &serverName, QObject *parent = Q_NULLPTR); + enum SecureMode { +#ifndef QT_NO_SSL + SECURE_MODE, +#endif + NON_SECURE_MODE + }; + + explicit QWebSocketServer(const QString &serverName, SecureMode secureMode, QObject *parent = Q_NULLPTR); virtual ~QWebSocketServer(); bool listen(const QHostAddress &address = QHostAddress::Any, quint16 port = 0); @@ -76,6 +90,8 @@ public: quint16 serverPort() const; QHostAddress serverAddress() const; + SecureMode secureMode() const; + bool setSocketDescriptor(int socketDescriptor); int socketDescriptor() const; @@ -96,6 +112,10 @@ public: void setProxy(const QNetworkProxy &networkProxy); QNetworkProxy proxy() const; #endif +#ifndef QT_NO_SSL + void setSslConfiguration(const QSslConfiguration &sslConfiguration); + QSslConfiguration sslConfiguration() const; +#endif QList<QWebSocketProtocol::Version> supportedVersions() const; QList<QString> supportedProtocols() const; @@ -103,8 +123,13 @@ public: Q_SIGNALS: void acceptError(QAbstractSocket::SocketError socketError); + //TODO: should use a delegate iso of a synchronous signal void originAuthenticationRequired(QWebSocketCorsAuthenticator *pAuthenticator); void newConnection(); +#ifndef QT_NO_SSL + void peerVerifyError(const QSslError &error); + void sslErrors(const QList<QSslError> &errors); +#endif private: QWebSocketServerPrivate * const d_ptr; |