2018-09-17 19:25:45 +02:00
|
|
|
#include "proxyapplication.h"
|
|
|
|
|
|
2018-09-22 07:23:57 +02:00
|
|
|
#include "webserver.h"
|
2018-09-22 03:07:20 +02:00
|
|
|
#include "httprequest.h"
|
|
|
|
|
#include "httpresponse.h"
|
|
|
|
|
#include "httpclientconnection.h"
|
|
|
|
|
|
2018-09-22 07:23:57 +02:00
|
|
|
ProxyApplication::ProxyApplication(const QJsonObject &config, WebServer &webServer) :
|
|
|
|
|
WebApplication(&webServer), m_webServer(webServer)
|
2018-09-17 19:25:45 +02:00
|
|
|
{
|
2018-09-22 07:23:57 +02:00
|
|
|
Q_UNUSED(config)
|
2018-09-17 19:25:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ProxyApplication::start()
|
|
|
|
|
{
|
|
|
|
|
}
|
2018-09-22 03:07:20 +02:00
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
}
|