{"id":26315922,"url":"https://github.com/benidevo/http-server","last_synced_at":"2025-09-09T22:40:59.956Z","repository":{"id":282449857,"uuid":"937586523","full_name":"benidevo/http-server","owner":"benidevo","description":"A lightweight, modular HTTP/1.1 server implementation in Python. This project implements a basic HTTP server from scratch, following HTTP/1.1 specifications to handle client requests.","archived":false,"fork":false,"pushed_at":"2025-03-14T18:34:49.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-14T18:38:24.566Z","etag":null,"topics":["http","python"],"latest_commit_sha":null,"homepage":"","language":"Python","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/benidevo.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":"2025-02-23T12:35:45.000Z","updated_at":"2025-03-14T18:34:52.000Z","dependencies_parsed_at":"2025-03-14T18:38:26.518Z","dependency_job_id":"04025498-0adb-4c78-9738-5b4044e6d860","html_url":"https://github.com/benidevo/http-server","commit_stats":null,"previous_names":["benidevo/http-server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benidevo%2Fhttp-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benidevo%2Fhttp-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benidevo%2Fhttp-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benidevo%2Fhttp-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benidevo","download_url":"https://codeload.github.com/benidevo/http-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243729377,"owners_count":20338459,"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":["http","python"],"created_at":"2025-03-15T12:27:37.618Z","updated_at":"2025-03-15T12:27:38.136Z","avatar_url":"https://github.com/benidevo.png","language":"Python","readme":"# Python HTTP Server\n\nA lightweight, modular HTTP/1.1 server implementation in Python. This project implements a basic HTTP server from scratch, following HTTP/1.1 specifications to handle client requests.\n\n\u003e **Note**: This project is for educational purposes only and not intended for production use. It is currently a work in progress as features are being implemented incrementally.\n\n## Features\n\n- Complete HTTP/1.1 request and response handling\n- Modular architecture with clean separation of concerns\n- Type-safe implementation with comprehensive type annotations\n- Configurable server settings\n- Extensible routing system\n- Support for standard HTTP methods (GET, POST, PUT, DELETE, etc.)\n\n\n### Key Components\n\n- **Server**: Core HTTP server implementation with connection handling\n- **Router**: Request routing to appropriate handlers\n- **Request/Response**: HTTP message parsing and serialization\n- **Methods/Status**: Enums for HTTP methods and status codes\n- **Configs**: Server configuration management\n\n## Getting Started\n\n### Prerequisites\n\n- Python 3.11 or higher\n- pipenv (for dependency management)\n\n### Installation\n\n1. Clone the repository:\n   ```\n   git clone https://github.com/benidevo/http-server\n   cd http-server\n   ```\n\n2. Install dependencies:\n   ```\n   pipenv install\n   ```\n\n3. Install development dependencies (optional):\n   ```\n   pipenv install --dev\n   ```\n\n### Running the Server\n\nStart the server using the provided run script:\n\n```\nsh run.sh\n```\n\nOr use the Make command:\n\n```\nmake start\n```\n\nThe server will start on `localhost:4221` by default (configurable in `app/configs/__init__.py`).\n\n## Development\n\n### Code Formatting and Linting\n\nThe project uses:\n- Black for code formatting\n- isort for import sorting\n- mypy for static type checking\n\nRun formatting and linting:\n\n```\nmake format  # Format code\nmake lint    # Format and type-check code\n```\n\n\n## Architecture\n\n### Request Flow\n\n1. Client sends HTTP request to server\n2. Server parses the request into a `Request` object\n3. Router matches the request path to a handler\n4. Handler processes the request and returns a `Response`\n5. Server serializes and sends the response back to the client\n\n### Main Components\n\n- **HttpServer**: Manages socket connections and request handling\n- **Router**: Maps URL paths to handler functions\n- **Request/Response**: Data models for HTTP messages\n- **HttpMethod/Status**: Enumerations for HTTP protocol values\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenidevo%2Fhttp-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenidevo%2Fhttp-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenidevo%2Fhttp-server/lists"}