{"id":20114668,"url":"https://github.com/sebastienrousseau/http-handle","last_synced_at":"2025-08-15T19:19:30.510Z","repository":{"id":257824515,"uuid":"871681056","full_name":"sebastienrousseau/http-handle","owner":"sebastienrousseau","description":"Http Handle is a fast and lightweight Rust library for handling HTTP requests and responses. ","archived":false,"fork":false,"pushed_at":"2025-07-25T14:30:43.000Z","size":1304,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-04T13:27:16.784Z","etag":null,"topics":["http","http-handle","http-server","rust","rust-library"],"latest_commit_sha":null,"homepage":"http://doc.http-handle.com/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sebastienrousseau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/funding.yml","license":"LICENSE-APACHE","code_of_conduct":".github/CODE-OF-CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"sebastienrousseau","custom":"https://paypal.me/wwdseb"}},"created_at":"2024-10-12T16:34:17.000Z","updated_at":"2024-11-15T15:12:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"3059e620-fd6f-44ed-b6a8-4fb5a00a6218","html_url":"https://github.com/sebastienrousseau/http-handle","commit_stats":null,"previous_names":["sebastienrousseau/http-handle"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/sebastienrousseau/http-handle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastienrousseau%2Fhttp-handle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastienrousseau%2Fhttp-handle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastienrousseau%2Fhttp-handle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastienrousseau%2Fhttp-handle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sebastienrousseau","download_url":"https://codeload.github.com/sebastienrousseau/http-handle/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastienrousseau%2Fhttp-handle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270617847,"owners_count":24617123,"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","status":"online","status_checked_at":"2025-08-15T02:00:12.559Z","response_time":110,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","http-handle","http-server","rust","rust-library"],"created_at":"2024-11-13T18:31:12.132Z","updated_at":"2025-08-15T19:19:30.486Z","avatar_url":"https://github.com/sebastienrousseau.png","language":"Rust","funding_links":["https://github.com/sponsors/sebastienrousseau","https://paypal.me/wwdseb"],"categories":[],"sub_categories":[],"readme":"\u003c!-- markdownlint-disable MD033 MD041 --\u003e\n\u003cimg src=\"https://kura.pro/http-handle/images/logos/http-handle.svg\"\nalt=\"Http Handle logo\" height=\"66\" align=\"right\" /\u003e\n\u003c!-- markdownlint-enable MD033 MD041 --\u003e\n\n# HTTP Handle (http-handle)\n\nA Rust-based HTTP server for serving static websites.\n\n\u003c!-- markdownlint-disable MD033 MD041 --\u003e\n\u003ccenter\u003e\n\u003c!-- markdownlint-enable MD033 MD041 --\u003e\n\n[![Made With Love][made-with-rust]][08] [![Crates.io][crates-badge]][03] [![lib.rs][libs-badge]][01] [![Docs.rs][docs-badge]][04] [![Codecov][codecov-badge]][06] [![Build Status][build-badge]][07] [![GitHub][github-badge]][09]\n\n• [Website][00] • [Documentation][04] • [Report Bug][02] • [Request Feature][02] • [Contributing Guidelines][05]\n\n\u003c!-- markdownlint-disable MD033 MD041 --\u003e\n\u003c/center\u003e\n\u003c!-- markdownlint-enable MD033 MD041 --\u003e\n\n## Overview\n\nThe `http-handle` is a robust Rust library designed for serving static websites. It provides a simple yet efficient HTTP server implementation with features like request parsing, response generation, and basic security measures. The library is not intended to be a full-fledged web server but rather a lightweight solution for serving static files over HTTP for development and testing purposes.\n\n## Features\n\n- **Static File Serving**: Serve static files from a configured document root.\n- **Request Parsing**: Parse incoming HTTP requests with proper error handling.\n- **Response Generation**: Generate appropriate HTTP responses based on requests.\n- **Security Measures**: Prevent directory traversal attacks.\n- **Content Type Detection**: Automatically detect and set appropriate content types for files.\n- **Customizable 404 Handling**: Support for custom 404 error pages.\n- **Threaded Connections**: Handle multiple connections concurrently using threads.\n- **Configurable Server**: Easy configuration of server address and document root.\n\n## Installation\n\nAdd this to your `Cargo.toml`:\n\n```toml\n[dependencies]\nhttp-handle = \"0.0.2\"\n```\n\n## Usage\n\nHere's a basic example of how to use `http-handle`:\n\n```rust\nuse http_handle::Server;\nuse std::thread;\nuse std::time::Duration;\n\nfn main() -\u003e std::io::Result\u003c()\u003e {\n    // Create a new server with an address and document root\n    let server = Server::new(\"127.0.0.1:8080\", \"./public\");\n\n    // Run the server in a separate thread so it doesn't block\n    let server_handle = thread::spawn(move || {\n        server.start().expect(\"Server failed to start\");\n    });\n\n    // Let the server run for 2 seconds before shutting it down\n    thread::sleep(Duration::from_secs(2));\n\n    println!(\"Server has been running for 2 seconds, shutting down...\");\n    \n    // In a real-world scenario, you would need to implement a proper shutdown signal\n    // This just exits the program after the duration.\n    \n    Ok(())\n}\n```\n\nThis will start a server listening on `127.0.0.1:8080`, serving files from the `./public` directory.\n\n## Documentation\n\nFor full API documentation, please visit [docs.rs/http-handle][04].\n\n## Examples\n\nTo explore more examples, clone the repository and run the following command:\n\n```shell\ncargo run --example example_name\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under either of\n\n- [Apache License, Version 2.0][10]\n- [MIT license][11]\n\nat your option.\n\n## Acknowledgements\n\nSpecial thanks to all contributors who have helped build the `http-handle` library.\n\n[00]: https://http-handle.com\n[01]: https://lib.rs/crates/http-handle\n[02]: https://github.com/sebastienrousseau/http-handle/issues\n[03]: https://crates.io/crates/http-handle\n[04]: https://docs.rs/http-handle\n[05]: https://github.com/sebastienrousseau/http-handle/blob/main/CONTRIBUTING.md\n[06]: https://codecov.io/gh/sebastienrousseau/http-handle\n[07]: https://github.com/sebastienrousseau/http-handle/actions?query=branch%3Amain\n[08]: https://www.rust-lang.org/\n[09]: https://github.com/sebastienrousseau/http-handle\n[10]: https://www.apache.org/licenses/LICENSE-2.0\n[11]: https://opensource.org/licenses/MIT\n\n[build-badge]: https://img.shields.io/github/actions/workflow/status/sebastienrousseau/http-handle/release.yml?branch=main\u0026style=for-the-badge\u0026logo=github\n[codecov-badge]: https://img.shields.io/codecov/c/github/sebastienrousseau/http-handle?style=for-the-badge\u0026token=OOnQTi8yIQ\u0026logo=codecov\n[crates-badge]: https://img.shields.io/crates/v/http-handle.svg?style=for-the-badge\u0026color=fc8d62\u0026logo=rust\n[docs-badge]: https://img.shields.io/badge/docs.rs-http--handle-66c2a5?style=for-the-badge\u0026labelColor=555555\u0026logo=docs.rs\n[github-badge]: https://img.shields.io/badge/github-sebastienrousseau/http--handle-8da0cb?style=for-the-badge\u0026labelColor=555555\u0026logo=github\n[libs-badge]: https://img.shields.io/badge/lib.rs-v0.0.2-orange.svg?style=for-the-badge\n[made-with-rust]: https://img.shields.io/badge/rust-f04041?style=for-the-badge\u0026labelColor=c0282d\u0026logo=rust\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebastienrousseau%2Fhttp-handle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsebastienrousseau%2Fhttp-handle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebastienrousseau%2Fhttp-handle/lists"}