diff --git a/proxyapplication.cpp b/proxyapplication.cpp index 8241896..84f721c 100644 --- a/proxyapplication.cpp +++ b/proxyapplication.cpp @@ -1,5 +1,9 @@ #include "proxyapplication.h" +#include "httprequest.h" +#include "httpresponse.h" +#include "httpclientconnection.h" + ProxyApplication::ProxyApplication(const QJsonObject &config, QObject *parent) : WebApplication(parent) { @@ -10,3 +14,11 @@ void ProxyApplication::start() { } + +void ProxyApplication::handleRequest(HttpClientConnection *connection, const HttpRequest &request) +{ + HttpResponse response; + response.protocol = request.protocol; + response.statusCode = HttpResponse::StatusCode::OK; + connection->sendResponse(response, "Hello from ProxyApplication: " + request.path); +} diff --git a/proxyapplication.h b/proxyapplication.h index 642f870..82be796 100644 --- a/proxyapplication.h +++ b/proxyapplication.h @@ -12,4 +12,6 @@ public: ProxyApplication(const QJsonObject &config, QObject *parent = Q_NULLPTR); void start() Q_DECL_OVERRIDE; + + void handleRequest(HttpClientConnection *connection, const HttpRequest &request) Q_DECL_OVERRIDE; };