#ifndef PROXYSERVER_H #define PROXYSERVER_H #include #include #include #include "proxyclient.h" #include "jsonrpcserver.h" #include "transportinterface.h" namespace remoteproxy { class ProxyServer : public QObject { Q_OBJECT public: explicit ProxyServer(QObject *parent = nullptr); ~ProxyServer(); void registerTransportInterface(TransportInterface *interface); private: JsonRpcServer *m_jsonRpcServer = nullptr; QList m_transportInterfaces; QHash m_proxyClients; QHash m_authenticatedClients; void sendResponse(TransportInterface *interface, const QUuid &clientId, const QVariantMap &response = QVariantMap()); private slots: void onClientConnected(const QUuid &clientId); void onClientDisconnected(const QUuid &clientId); void onClientDataAvailable(const QUuid &clientId, const QByteArray &data); void onProxyClientAuthenticated(); void onProxyClientTunnelConnected(); public slots: void startServer(); void stopServer(); }; } #endif // PROXYSERVER_H