This is a minimalist webserver which supports responding to basic GET requests for txt
, ico
& pdf
files. It supports handling concurrent requests using multithreading.
-
First add the content that you want to have the ability of serving to the
/content
directory. -
Run the following commands on the terminal:
make
./server <port-you-want-to-run-on>
The server provides a default response, when no url parameters are passed. This response is stored int the hello.txt
file. Please change if needed.
If you want to run the server in a debugging session,
- Clone repo
git clone https://github.com/haathim/CN2-WebServer.git
cd CN2-WebServer
#checkout to correct branch (if not already)
git checkout multithread
- Build the debug binary
make server-dbg
- Run GDB
gdb ./server-dbg
#set neccassary breakpoints
(gdb) run <port-you-want-to-run-on>
Please note that is not a webserver developed for production use cases.