{"id":18676998,"url":"https://github.com/abdulsamie10/http-server-c","last_synced_at":"2025-08-01T22:38:51.403Z","repository":{"id":150726343,"uuid":"623130153","full_name":"abdulsamie10/HTTP-Server-C","owner":"abdulsamie10","description":"This repository contains the code of HTTP, which accepts requests and response based on the requests.","archived":false,"fork":false,"pushed_at":"2023-04-19T02:59:22.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-27T20:49:48.338Z","etag":null,"topics":["c","c-language","c-programming","edit","get","http","http-server","post","programming","read","server","ubuntu","write"],"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/abdulsamie10.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}},"created_at":"2023-04-03T18:56:19.000Z","updated_at":"2023-04-19T03:03:12.000Z","dependencies_parsed_at":"2023-08-23T09:39:52.040Z","dependency_job_id":null,"html_url":"https://github.com/abdulsamie10/HTTP-Server-C","commit_stats":null,"previous_names":["abdulsamie10/http-server-c"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdulsamie10%2FHTTP-Server-C","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdulsamie10%2FHTTP-Server-C/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdulsamie10%2FHTTP-Server-C/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdulsamie10%2FHTTP-Server-C/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abdulsamie10","download_url":"https://codeload.github.com/abdulsamie10/HTTP-Server-C/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239523508,"owners_count":19652948,"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","c-language","c-programming","edit","get","http","http-server","post","programming","read","server","ubuntu","write"],"created_at":"2024-11-07T09:32:05.109Z","updated_at":"2025-02-18T18:20:34.678Z","avatar_url":"https://github.com/abdulsamie10.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HTTP Server in C\nThis repository contains a simple multithreaded HTTP server implemented in C. The server supports basic HTTP methods (GET and POST) and provides endpoints for testing and statistics gathering.\n\n# Features\nMultithreaded handling of client connections\nGET and POST methods supported\n\n# Built-in endpoints:\n  1. /ping: Responds with \"pong\"\n  2. /echo: Responds with request headers\n  3. /write: Writes POST request body to the server\n  4. /read: Reads the data written to the server via /write endpoint\n  5. /stats: Shows server statistics, including the number of requests, header bytes, body bytes, errors, and error bytes\n  \n# Prerequisites\n  1. GCC (GNU Compiler Collection) or any other C compiler\n  2. GNU Make (optional)  \n\n# Compilation\nTo compile the server, run the following command in your terminal:\n```\ngcc -o server server.c -lpthread\n```\nThis will create an executable named server in the current directory. If you have GNU Make installed, you can alternatively run make to build the server.\n\n# Usage\nTo start the server, run the following command in your terminal:\n```\n./server\n```\nThe server will listen for incoming connections on port 8080. You can interact with the server using any HTTP client, such as curl, a web browser, or a custom client.\n\n# Example Requests\n  1. GET /ping\n  \n    curl -X GET http://localhost:8080/ping\n  2. GET /echo\n  ```\n  curl -X GET -H \"Custom-Header: MyValue\" http://localhost:8080/echo\n  ```\n  3. POST /write\n  ```\n  curl -X POST -H \"Content-Type: text/plain\" -d \"Hello, World!\" http://localhost:8080/write\n  ```\n  4. GET /read\n  ```\n  curl -X GET http://localhost:8080/read\n  ```\n  5. GET /stats\n  ```\n  curl -X GET http://localhost:8080/stats\n  ```\n# Limitations\n  1. This server is not designed for production use and may not be secure or efficient\n  2. The server does not support HTTP/2 or any other protocol except for HTTP/1.1\n  3. Error handling and logging are minimal\n  4. The server does not support HTTPS (TLS/SSL)  \n  \n# Contributing\nContributions to this project are welcome! If you'd like to make improvements, fix bugs, or add new features, please follow these steps:\n\n  1. Fork this repository on GitHub\n  2. Create a new branch for your changes\n  3. Make your changes, ensuring that your code follows the project's style and is well-documented\n  4. Test your changes to ensure they work as expected and do not introduce new bugs\n  5. Submit a pull request to the original repository with a clear and concise description of your changes\n\n\n# License\nThis project is licensed under the MIT License. Please see the LICENSE file for more information.\n\n# Support\nIf you encounter any issues or have questions about the project, feel free to open an issue on GitHub or submit a pull request with your proposed changes. Alternatively, you can contact the repository owner through their GitHub profile.\n\n# Future Work\n  1. Enhance error handling and logging for better debugging and monitoring\n  2. Add support for additional HTTP methods, such as PUT and DELETE\n  3. Implement HTTPS (TLS/SSL) support for secure communication\n  4. Optimize server performance for better handling of large numbers of simultaneous connections\n  5. Add support for HTTP/2 and other protocols to improve performance and compatibility with modern clients\n  6. Create a more extensive test suite to ensure the server's reliability and correctness\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdulsamie10%2Fhttp-server-c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabdulsamie10%2Fhttp-server-c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdulsamie10%2Fhttp-server-c/lists"}