{"id":22513245,"url":"https://github.com/raghavayushman/c_web_server","last_synced_at":"2026-05-04T02:35:01.040Z","repository":{"id":266534199,"uuid":"898620619","full_name":"raghavayushman/C_Web_Server","owner":"raghavayushman","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-04T18:15:04.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T03:18:33.091Z","etag":null,"topics":["c","networking","server","web","websocket"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/raghavayushman.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-12-04T18:08:56.000Z","updated_at":"2024-12-04T18:15:07.000Z","dependencies_parsed_at":"2024-12-04T19:23:16.173Z","dependency_job_id":"19c87368-d4cd-4b07-801c-025aeef6bcfa","html_url":"https://github.com/raghavayushman/C_Web_Server","commit_stats":null,"previous_names":["raghavayushman/c_web_server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raghavayushman%2FC_Web_Server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raghavayushman%2FC_Web_Server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raghavayushman%2FC_Web_Server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raghavayushman%2FC_Web_Server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raghavayushman","download_url":"https://codeload.github.com/raghavayushman/C_Web_Server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245950604,"owners_count":20699098,"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","networking","server","web","websocket"],"created_at":"2024-12-07T03:10:48.978Z","updated_at":"2026-05-04T02:35:01.003Z","avatar_url":"https://github.com/raghavayushman.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Web Server in C\n\n## Overview\nThis project is a simple, lightweight web server written in C that demonstrates the fundamentals of handling HTTP requests and serving content. It is designed to process incoming client requests, interpret them, and serve static files (like HTML, CSS, and images) from a local directory.\n\n## Features\n- **Handles HTTP Requests**: The server listens on a specified port and accepts incoming HTTP requests.\n- **Supports GET Method:** The server currently supports the GET method for retrieving files from the server.\n- **Static File Serving:** Serve static files (HTML, CSS, JavaScript, images) to the client.\n- **Basic HTTP Response Handling:** Send basic HTTP responses, including headers (e.g., `200 OK` for successful requests).\n- **Multi-threaded:** Supports handling multiple client connections simultaneously using threading.\n\n## Installation\nTo compile and run the web server on your local machine, follow these steps:\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/raghavayushman/web-server-c.git\n   cd web-server-c\n   ```\n\n2. Compile the source code:\n   ```bash\n   gcc -o webserver webserver.c -lpthread\n   ```\n\n3. Run the server:\n   ```bash\n   ./webserver\n   ```\n\n   The server will start and listen on port 8080 by default.\n\n4. Access the web server in your browser by navigating to `http://localhost:8080`.\n\n## Usage\nOnce the server is running, you can test it by navigating to any supported file within the directory. For example:\n\n- `http://localhost:8080/index.html`\n- `http://localhost:8080/styles.css`\n\nIf the requested file exists in the server's root directory, it will be served. Otherwise, the server will return a `404 Not Found` error.\n\n## Customization\nYou can modify the server to suit your needs by:\n- Changing the port number in the source code.\n- Adding additional HTTP methods.\n- Enhancing error handling.\n- Supporting dynamic content generation (e.g., integrating with a backend language).\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n---\n\nThis project serves as a simple, educational example of how web servers work under the hood. It's a great starting point for learning about networking, HTTP, and multi-threading in C.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraghavayushman%2Fc_web_server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraghavayushman%2Fc_web_server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraghavayushman%2Fc_web_server/lists"}