27 lines
878 B
C++
27 lines
878 B
C++
#include "proxyhandler.h"
|
|
#include <QThread>
|
|
|
|
bool http::ProxyHandler::loadPlugin(QObject *proxy)
|
|
{
|
|
auto inst = qobject_cast<ProxyInterface*>(proxy);
|
|
if(!inst) {
|
|
return false;
|
|
}
|
|
|
|
qDebug("loading proxy");
|
|
|
|
auto thread = new QThread;
|
|
proxy->moveToThread(thread);
|
|
// TODO: get path from config or something
|
|
inst->path = "tcp://127.0.0.1:12345";
|
|
QObject::connect(thread, SIGNAL (started()), proxy, SLOT (process()));
|
|
//QObject::connect(proxy, SIGNAL (error(QString)), this, SLOT (errorString(QString)));
|
|
//QObject::connect(proxy, SIGNAL (message(http::Flow)), current_session, SLOT (saveFlow(http::Flow)), Qt::QueuedConnection);
|
|
//QObject::connect(proxy, SIGNAL (message(http::Flow)), this, SLOT (updateHistory()), Qt::QueuedConnection);
|
|
|
|
thread->start();
|
|
|
|
//proxies.insert({"foo", inst, thread});
|
|
|
|
return true;
|
|
}
|