{"id":17948674,"url":"https://github.com/tony-artz/c-http-server","last_synced_at":"2026-01-30T17:31:08.252Z","repository":{"id":258399462,"uuid":"873859298","full_name":"Tony-ArtZ/c-http-server","owner":"Tony-ArtZ","description":"A simple HTTP 1.1 Web server made using C and Sockets sys calls in Linux","archived":false,"fork":false,"pushed_at":"2024-10-22T05:08:25.000Z","size":881,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T18:02:56.574Z","etag":null,"topics":["c","cmake","gnu","gnu-linux","http","http-server","linux","socket","socket-programming","sockets","web","webserver"],"latest_commit_sha":null,"homepage":"","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/Tony-ArtZ.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-10-16T20:57:55.000Z","updated_at":"2024-11-07T19:43:55.000Z","dependencies_parsed_at":"2024-10-22T11:11:48.249Z","dependency_job_id":null,"html_url":"https://github.com/Tony-ArtZ/c-http-server","commit_stats":null,"previous_names":["tony-artz/c-http-server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tony-ArtZ%2Fc-http-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tony-ArtZ%2Fc-http-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tony-ArtZ%2Fc-http-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tony-ArtZ%2Fc-http-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tony-ArtZ","download_url":"https://codeload.github.com/Tony-ArtZ/c-http-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251747790,"owners_count":21637404,"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":["c","cmake","gnu","gnu-linux","http","http-server","linux","socket","socket-programming","sockets","web","webserver"],"created_at":"2024-10-29T09:08:35.377Z","updated_at":"2026-01-30T17:31:08.234Z","avatar_url":"https://github.com/Tony-ArtZ.png","language":"C","readme":"# Simple C Web Server\n\nThis project is a basic web server written in C that serves static files (HTML, CSS, images, etc.) over HTTP. The server listens on port 8080 and handles GET requests to serve files from the project directory.\n\n## Features\n- Serves static HTML, CSS, JavaScript, and image files.\n- Basic MIME type detection based on file extensions.\n- Handles `GET` requests and returns 404 for missing files.\n- Built using low-level socket programming and system calls.\n\n## Directory Structure\n\n```\n├── MakeFile         # Compilation instructions\n├── a.out            # Executable (optional, can be ignored)\n├── about.html       # Sample HTML file\n├── handler.c        # Handles incoming client requests\n├── index.html       # Main page served by the server\n├── main.c           # Entry point of the server program\n├── mime.c           # MIME type detection based on file extension\n├── public/          # Static assets (CSS, images)\n│   ├── index.css    # Stylesheet\n│   └── space.jpg    # Example image\n├── server.c         # Socket setup and HTTP response handling\n├── server.h         # Header file for shared function prototypes\n```\n\n## Compilation and Execution\n\n### Prerequisites\n\n- You need to have `gcc` and `make` installed on your system. If you are using Ubuntu in WSL, you can install them with:\n  \n  ```bash\n  sudo apt update\n  sudo apt install build-essential\n  ```\n\n### Build the Project\n\nYou can compile the project using the provided `MakeFile`:\n\n```bash\nmake\n```\n\nThis will generate an executable named `server`.\n\n### Running the Server\n\nAfter compiling, you can run the server with:\n\n```bash\n./server\n```\n\nThe server will start listening on `localhost:8080`.\n\n### Accessing the Server\n\nOnce the server is running, open your web browser and navigate to:\n\n```\nhttp://localhost:8080\n```\n\nYou can view the `index.html` or other files in the directory. For example, you can also access:\n\n```\nhttp://localhost:8080/about.html\nhttp://localhost:8080/public/index.css\nhttp://localhost:8080/public/space.jpg\n```\n\n## Clean Up\n\nTo remove the compiled files (object files and executables), run:\n\n```bash\nmake clean\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftony-artz%2Fc-http-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftony-artz%2Fc-http-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftony-artz%2Fc-http-server/lists"}