From a91a264a7a282e471325043108a1580114008bcf Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Mon, 17 Jan 2022 14:05:21 +0000 Subject: [PATCH] Creates barebones server to respond When the proxy is requested directly (without an host to pass the request to), we want to respond with something. In burp, you can download the certificate from here. In time, I'd like this to do the same. I'd also like the proxy server to be interacted with via an API - this webserver will eventually deal with that as well although that is a little way off. --- src/webserver.c | 7 +++++++ src/webserver.h | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/webserver.c create mode 100644 src/webserver.h diff --git a/src/webserver.c b/src/webserver.c new file mode 100644 index 0000000..03ea5cd --- /dev/null +++ b/src/webserver.c @@ -0,0 +1,7 @@ +#include "webserver.h" + +char* webserverGetResponse( Request *req ){ + Response *rsp = newResponse(); + responseSetBody(rsp, "Test", 1); + return responseToString(rsp); +} diff --git a/src/webserver.h b/src/webserver.h new file mode 100644 index 0000000..f651743 --- /dev/null +++ b/src/webserver.h @@ -0,0 +1,16 @@ +#ifndef WEBSERVER_H +#define WEBSERVER_H + +#include +#include + +#include "request.h" +#include "response.h" + +char* webserverGetResponse( Request *req ); + +#endif /* ifndef WEBSERVER_H + +include "stdlib.h" +include "stdio.h" + */