{"id":17665286,"url":"https://github.com/7etsuo/http-server","last_synced_at":"2025-06-19T17:33:57.032Z","repository":{"id":259281410,"uuid":"861116710","full_name":"7etsuo/http-server","owner":"7etsuo","description":"HTTP Server in C","archived":false,"fork":false,"pushed_at":"2024-09-22T04:02:22.000Z","size":11,"stargazers_count":32,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-12T04:52:56.430Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/7etsuo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-22T03:33:20.000Z","updated_at":"2025-04-10T11:20:09.000Z","dependencies_parsed_at":"2024-10-24T03:50:36.511Z","dependency_job_id":"09a6bdcb-b9f7-46fd-a097-8592ec6be424","html_url":"https://github.com/7etsuo/http-server","commit_stats":null,"previous_names":["7etsuo/http-server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/7etsuo%2Fhttp-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/7etsuo%2Fhttp-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/7etsuo%2Fhttp-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/7etsuo%2Fhttp-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/7etsuo","download_url":"https://codeload.github.com/7etsuo/http-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248519472,"owners_count":21117757,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-23T21:01:14.445Z","updated_at":"2025-04-12T04:53:05.723Z","avatar_url":"https://github.com/7etsuo.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/user-attachments/assets/07113e1e-408c-4c65-9bd9-132ba4030af8\" alt=\"Logo\" width=\"200\" /\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eHTTP Server in C\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eThis project implements a simple HTTP server in C. It handles various HTTP methods, processes requests, and generates responses based on client requests. The server is built using low-level socket programming and custom HTTP request/response handling.\u003c/strong\u003e\n\u003c/p\u003e\n\n---\n\n\u003ch3 align=\"center\"\u003eConnect with me:\u003c/h3\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.x.com/7etsuo\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/X-7etsuo-blue?style=flat\u0026logo=x\" alt=\"X Profile\" /\u003e\n  \u003c/a\u003e\n  \u0026nbsp;\n  \u003ca href=\"https://www.discord.gg/c-asm\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Discord-c--asm-7289DA?style=flat\u0026logo=discord\" alt=\"Discord Server\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n### Features:\n- **HTTP Request Parsing:** Support for multiple HTTP methods including GET, POST, PUT, DELETE, and more.\n- **Request Dispatching:** Dispatches requests based on URI and method.\n- **Non-Blocking I/O:** Uses non-blocking sockets to handle multiple clients concurrently.\n- **Customizable Response:** Dynamically builds and sends HTTP responses based on the request and server logic.\n- **Modular Design:** Organized into multiple files for handling sockets, HTTP requests, responses, and server operations.\n\n### Files Overview:\n- `http_handler.c` / `http_handler.h`: Manages the request handling and dispatch logic.\n- `my_socket.c` / `my_socket.h`: Contains functions for setting up and managing server sockets.\n- `request.c` / `request.h`: Responsible for parsing HTTP requests and managing request headers and body.\n- `response.c` / `response.h`: Handles building and formatting HTTP responses, including headers and body.\n- `server.c`: Main entry point of the server, manages client connections and the server loop.\n- `my_http.h`: Contains common HTTP-related constants and definitions used across the project.\n\n### Usage:\n1. **Clone the repository:**\n   `git clone [repository URL]`\n2. **Compile the project:**\n   Navigate to the project directory and run `make`.\n3. **Run the server:**\n   Execute `./server` and handle incoming HTTP requests on the specified port.\n\n### Example:\nStart the server and visit `http://localhost:4221/` to interact with it. It handles routes like `/`, `/echo/`, and `/user-agent` and responds with the appropriate content.\n\n### Requirements:\n- **Compiler:** GCC (or another C compiler)\n- **Environment:** POSIX-compliant system (Linux/macOS)\n\nThis project serves as a base for further extensions like adding more HTTP methods, handling file uploads, or implementing a full-fledged web server.\n\n---\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F7etsuo%2Fhttp-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F7etsuo%2Fhttp-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F7etsuo%2Fhttp-server/lists"}