This is a basic multi-threaded HTTP server written in C without any third-party library. The server listens on a port (4221). You can use curl
to test the server.
I had already added this to my todo listen after I wrote a TCP Server in C but since Build your own HTTP server at CodeCrafters was free this month, I built one just a few hours. The code is bad tho. Have to clean it up.
-
Clone the repository
-
Compile client and server programs (don't worry, there's a Makefile to do this for you)
make
-
Run the server (it will run on port 4221)
./bin/server
-
Use
curl
to test the server.curl -v localhost:4221/echo/abc
-
Ctrl+C to stop the server