#ifndef WEBSOCKETCLIENT_H
#define WEBSOCKETCLIENT_H

#include <QObject>
#include <QtWebSockets/QWebSocket>
#include <QJsonDocument>
#include <QJsonArray>
#include <QJsonObject>
#include <QJsonValue>
#include <QVariant>
#include <QJsonParseError>

#include <openssl/rsa.h>
#include <openssl/pem.h>
#include <openssl/bn.h>
#include <openssl/bio.h>
#include <openssl/evp.h>
#include <openssl/ssl.h>
#include <openssl/err.h>

class WebsocketClient : public QObject
{
    Q_OBJECT
public:
    explicit WebsocketClient(QWebSocket *so,QObject *parent = nullptr);
    ~WebsocketClient();

    //解密函数
    QString rsa_pri_decrypt_base64(const QString &strDecryptData);

signals:
    void closed();

public slots:
    void processTextMessage(QString message);
    void socketDisconnected();

private:
    QWebSocket *m_client;
};

#endif // WEBSOCKETCLIENT_H
