websocketclient.h 856 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef WEBSOCKETCLIENT_H
  2. #define WEBSOCKETCLIENT_H
  3. #include <QObject>
  4. #include <QtWebSockets/QWebSocket>
  5. #include <QJsonDocument>
  6. #include <QJsonArray>
  7. #include <QJsonObject>
  8. #include <QJsonValue>
  9. #include <QVariant>
  10. #include <QJsonParseError>
  11. #include <openssl/rsa.h>
  12. #include <openssl/pem.h>
  13. #include <openssl/bn.h>
  14. #include <openssl/bio.h>
  15. #include <openssl/evp.h>
  16. #include <openssl/ssl.h>
  17. #include <openssl/err.h>
  18. class WebsocketClient : public QObject
  19. {
  20. Q_OBJECT
  21. public:
  22. explicit WebsocketClient(QWebSocket *so,QObject *parent = nullptr);
  23. ~WebsocketClient();
  24. //解密函数
  25. QString rsa_pri_decrypt_base64(const QString &strDecryptData);
  26. signals:
  27. void closed();
  28. public slots:
  29. void processTextMessage(QString message);
  30. void socketDisconnected();
  31. private:
  32. QWebSocket *m_client;
  33. };
  34. #endif // WEBSOCKETCLIENT_H