https://github.com/bernoussama/httpc
Simple HTTP server in C
https://github.com/bernoussama/httpc
Last synced: 5 months ago
JSON representation
Simple HTTP server in C
- Host: GitHub
- URL: https://github.com/bernoussama/httpc
- Owner: bernoussama
- License: mit
- Created: 2024-07-14T12:04:37.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-12-06T01:27:27.000Z (over 1 year ago)
- Last Synced: 2026-01-26T07:37:04.620Z (5 months ago)
- Language: C
- Homepage:
- Size: 396 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![MIT License][license-shield]][license-url]
[](https://www.codefactor.io/repository/github/bernoussama/httpc)
HTTPC
[](https://app.codecrafters.io/users/codecrafters-bot?r=2qF)
## About
[HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) is the
protocol that powers the web. In this ["Build Your Own HTTP server" Challenge](https://app.codecrafters.io/courses/http-server/overview), 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](https://app.codecrafters.io/r/cute-gorilla-362426). I will get one too.
## Getting Started
The entry point for the HTTP server implementation is in `app/server.c`.
```sh
# compile the server
gcc -lz -lcurl app/*.c -o server
# start the server
./server --directory /tmp/
```
## Roadmap
- [x] Bind to a port
- [x] Respond with 200
- [x] Respond with body
- [x] Read header
- [x] Concurrent connections
- [x] Return a file
- [x] Read request body
- [ ] HTTP compression
- [ ] Compression headers
- [ ] Multiple Compression schemes
- [ ] Gzip compression
## Contributing
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!
1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request
## License
Distributed under the MIT License. See [LICENSE](https://github.com/bernoussama/httpc/blob/master/licence.txt) for more information.
## Contact
Oussama Bernou - [@bernoussama](https://x.com/bernoussama) - contact@bernoussama.com
### Built With
[![C][C-shield]][C-url]
## Resources
- [HTTP request syntax](https://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html)
- [Threading in C](https://www.geeksforgeeks.org/multithreading-in-c)
- The challenge instructions were also a good help.
[license-shield]: https://img.shields.io/github/license/bernoussama/httpc
[license-url]: https://github.com/bernoussama/httpc/blob/master/LICENSE.txt
[C-shield]: https://img.shields.io/badge/-0769AD?style=for-the-badge&logo=C&logoColor=white
[C-url]: https://en.wikipedia.org/wiki/C_(programming_language)