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.
This commit is contained in:
Jonathan Hodgson 2022-01-17 14:05:21 +00:00
parent a3a48a841e
commit a91a264a7a
2 changed files with 23 additions and 0 deletions

7
src/webserver.c Normal file
View file

@ -0,0 +1,7 @@
#include "webserver.h"
char* webserverGetResponse( Request *req ){
Response *rsp = newResponse();
responseSetBody(rsp, "Test", 1);
return responseToString(rsp);
}

16
src/webserver.h Normal file
View file

@ -0,0 +1,16 @@
#ifndef WEBSERVER_H
#define WEBSERVER_H
#include <stdlib.h>
#include <stdio.h>
#include "request.h"
#include "response.h"
char* webserverGetResponse( Request *req );
#endif /* ifndef WEBSERVER_H
include "stdlib.h"
include "stdio.h"
*/