Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shxntanu/http-server-c
🖥️ HTTP Sever implementation in C using Sockets!
https://github.com/shxntanu/http-server-c
c http-server portfolio
Last synced: 15 days ago
JSON representation
🖥️ HTTP Sever implementation in C using Sockets!
- Host: GitHub
- URL: https://github.com/shxntanu/http-server-c
- Owner: shxntanu
- Created: 2024-01-28T19:09:24.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-03-28T10:25:00.000Z (9 months ago)
- Last Synced: 2024-03-28T11:40:04.060Z (9 months ago)
- Topics: c, http-server, portfolio
- Language: C
- Homepage:
- Size: 54.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HTTP Server in C
HTTP is the protocol that powers the web. The [challenge](https://app.codecrafters.io/courses/http-server/introduction) was to build a HTTP server that's capable of handling simple GET/POST requests, serving files and handling multiple concurrent connections.
## Features
- Parses command-line arguments for the directory to serve files from.
- Handles GET requests for files in the specified directory.
- Handles POST requests to create new files in the specified directory.
- Responds with the appropriate HTTP status code (200 OK, 404 Not Found, etc.).
- Can echo back the User-Agent header from the request.## Usage
To get started, first you will need to make the script `start.sh` executable. To do this, run the following command:
```sh
chmod +x start.sh
```Then, you can start the server by running the following command:
```sh
./start.sh
```