{"id":19109191,"url":"https://github.com/thearyanahmed/rusttp","last_synced_at":"2026-02-02T11:38:40.898Z","repository":{"id":247160779,"uuid":"825036524","full_name":"thearyanahmed/rusttp","owner":"thearyanahmed","description":"It is the implementation of \"Implementing HyperText Transfer Protocol with RUST… maybe?\"","archived":false,"fork":false,"pushed_at":"2024-09-15T14:48:41.000Z","size":34,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T19:21:59.253Z","etag":null,"topics":["http","rust"],"latest_commit_sha":null,"homepage":"https://thearyanahmed.medium.com/implementing-hypertext-transfer-protocol-with-rust-maybe-f2494281d29c","language":"Rust","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/thearyanahmed.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-07-06T15:33:40.000Z","updated_at":"2024-09-15T14:48:45.000Z","dependencies_parsed_at":"2024-07-07T02:27:03.668Z","dependency_job_id":"e35d59a4-9fa6-47ee-af9a-d56321a84d1c","html_url":"https://github.com/thearyanahmed/rusttp","commit_stats":null,"previous_names":["thearyanahmed/rusttp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thearyanahmed%2Frusttp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thearyanahmed%2Frusttp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thearyanahmed%2Frusttp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thearyanahmed%2Frusttp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thearyanahmed","download_url":"https://codeload.github.com/thearyanahmed/rusttp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249557630,"owners_count":21291079,"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","rust"],"created_at":"2024-11-09T04:19:25.229Z","updated_at":"2026-02-02T11:38:35.854Z","avatar_url":"https://github.com/thearyanahmed.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rusttp\n\nrusttp is a simple, lightweight HTTP router built in Rust. It uses the Tokio library for asynchronous I/O and can handle multiple concurrent connections.\nThis is a learning project to understand how HTTP servers work and how to build one from scratch. It is not intended for production use.\n\nIt is the implementation of [https://thearyanahmed.medium.com/implementing-hypertext-transfer-protocol-with-rust-maybe-f2494281d29c](https://thearyanahmed.medium.com/implementing-hypertext-transfer-protocol-with-rust-maybe-f2494281d29c).\n\n## Features\n\n- Supports HTTP methods: GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD\n- Route handling with custom logic\n- Query parameter parsing\n- Header parsing\n- Error handling for invalid requests\n\n## Usage\n\nTo use rusttp, you need to create a `Router` instance, add routes to it, and then start the server.\n\nHere's a basic example:\n\n```rust\nuse rusttp::{Method, Request, Response, Router};\nuse std::sync::Arc;\nuse std::{fs, io};\n\n#[tokio::main]\nasync fn main() -\u003e io::Result\u003c()\u003e {\n    let mut router = Router::new();\n    router.add_route(Method::GET, \"/whoami\", who_handler);\n    router.add_route(Method::GET, \"/page\", page_handler);\n    router.add_route(Method::POST, \"/say-hi\", say_hi_handler);\n\n    let router = Arc::new(router);\n\n    router\n        .listen_and_serve(\"127.0.0.1:8000\")\n        .await\n        .expect(\"failed to listen and serve\");\n\n    Ok(())\n}\n```\n\nIn this example, we're adding several routes to the router. Each route is associated with a handler function that takes a `Request` and returns a `Response`.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nrusttp is licensed under the MIT license. Please see the `LICENSE` file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthearyanahmed%2Frusttp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthearyanahmed%2Frusttp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthearyanahmed%2Frusttp/lists"}