#pragma once #include "api.h" #include "proxyinterface.h" #include #include #include #include /* mitmproxy base plugin This plugin implements the interface for the basic mitmproxy plugin. */ class mitmproxyPlugin : public QObject, public http::ProxyInterface { Q_OBJECT Q_PLUGIN_METADATA(IID HTTPProxyInterfaceIID FILE "mitmproxy.json") Q_INTERFACES(http::ProxyInterface) private: std::set received; zmq::context_t context; zmq::socket_t *socket; std::set accepted_flows; bool is_connected = false; void connect(); void reconnect(); public: //! name of the plugin QString getName() override; //! returns, whether the proxy is currently connected bool connected() override; //! disconnects the handle void disconnect() override; public slots: //! called in a custom thread, may block. void process(); signals: void finished(); void error(QString err); void message(http::Flow flow); };