A simple HTTP server written in C using UNIX sockets. Supports GET and HEAD requests.
-
Install
make
. -
Clone this repository using this command:
git clone https://github.com/ketanhwr/http-server.git
-
Run
make
:make
-
Run the server:
[sudo] ./http-server
-
Open your web browser and head on to
localhost:10000
- Supports GET and HEAD requests.
- Looks for the file
index.html
in the current directory and serves it if found. - Returns Status Codes
200 (OK)
,400 (Bad Request)
and404 (Not Found)
- Serving multiple clients at once using multi-threading.
- Adding option to change ROOT directory and PORT number by passing them as arguments.
Show image files (.jpg/.png) files as well when opened.