HTTP is the protocol that powers the web. In this "Build Your Own HTTP server" Challenge, I built a multithreaded HTTP/1.1 server in C that is capable of serving multiple clients.
check out CodeCrafters programming challenges and get a free week using my referral link. I will get one too.
The entry point for the HTTP server implementation is in app/server.c
.
# compile the server
gcc -lz -lcurl app/*.c -o server
# start the server
./server --directory /tmp/
- Bind to a port
- Respond with 200
- Respond with body
- Read header
- Concurrent connections
- Return a file
- Read request body
- HTTP compression
- Compression headers
- Multiple Compression schemes
- Gzip compression
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
Oussama Bernou - @bernoussama - contact@bernoussama.com
Project Link: https://github.com/your_username/repo_name
-
The challenge instructions were also a good help.