{"id":13998131,"url":"https://github.com/Xudong-Huang/may_minihttp","last_synced_at":"2025-07-23T05:32:37.788Z","repository":{"id":48572437,"uuid":"117556625","full_name":"Xudong-Huang/may_minihttp","owner":"Xudong-Huang","description":"mini http implemented on top of may","archived":false,"fork":false,"pushed_at":"2024-10-07T12:13:11.000Z","size":141,"stargazers_count":624,"open_issues_count":1,"forks_count":41,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-11-21T01:06:47.165Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/Xudong-Huang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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}},"created_at":"2018-01-15T14:38:21.000Z","updated_at":"2024-11-20T13:19:50.000Z","dependencies_parsed_at":"2024-01-15T19:44:03.591Z","dependency_job_id":"c807e269-34e4-4dd3-a8ed-237bf8d0c8c9","html_url":"https://github.com/Xudong-Huang/may_minihttp","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xudong-Huang%2Fmay_minihttp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xudong-Huang%2Fmay_minihttp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xudong-Huang%2Fmay_minihttp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xudong-Huang%2Fmay_minihttp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Xudong-Huang","download_url":"https://codeload.github.com/Xudong-Huang/may_minihttp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227245132,"owners_count":17753239,"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":[],"created_at":"2024-08-09T19:01:25.124Z","updated_at":"2024-11-30T00:31:11.612Z","avatar_url":"https://github.com/Xudong-Huang.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# may_minihttp\n\nMini http server that implemented on top of [may](https://github.com/Xudong-Huang/may)\n\nThis crate is ported from [tokio_minihttp](https://github.com/tokio-rs/tokio-minihttp).\nBut with much ease of use, you can call `MAY` block APIs directly in your service.\n\n[![Build Status](https://github.com/Xudong-Huang/may_minihttp/workflows/CI/badge.svg)](https://github.com/Xudong-Huang/may_minihttp/actions?query=workflow%3ACI+branch%3Amaster)\n[![Crate](https://img.shields.io/crates/v/may_minihttp.svg)](https://crates.io/crates/may_minihttp)\n\n## Usage\n\nFirst, add this to your `Cargo.toml`:\n\n```toml\n[dependencies]\nmay_minihttp = \"0.1\"\n```\n\nThen just simply implement your http service\n\n```rust,no_run\nextern crate may_minihttp;\n\nuse std::io;\nuse may_minihttp::{HttpServer, HttpService, Request, Response};\n\n#[derive(Clone)]\nstruct HelloWorld;\n\nimpl HttpService for HelloWorld {\n    fn call(\u0026mut self, _req: Request, res: \u0026mut Response) -\u003e io::Result\u003c()\u003e {\n        res.body(\"Hello, world!\");\n        Ok(())\n    }\n}\n\n// Start the server in `main`.\nfn main() {\n    let server = HttpServer(HelloWorld).start(\"0.0.0.0:8080\").unwrap();\n    server.join().unwrap();\n}\n```\n\n## Performance\nTested with only one working thread on my laptop\n\nBoth with the following command to start the server.\n```\n$ cargo run --example=hello-world --release\n```\n\n**tokio_minihttp**\n```sh\n$ wrk http://127.0.0.1:8080 -d 10 -t 1 -c 200\nRunning 10s test @ http://127.0.0.1:8080\n  1 threads and 200 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency     1.98ms  284.06us  12.53ms   98.92%\n    Req/Sec   101.64k     1.76k  103.69k    91.00%\n  1011679 requests in 10.05s, 99.38MB read\nRequests/sec: 100650.94\nTransfer/sec:      9.89MB\n```\n\n**may_minihttp**\n```sh\n$ wrk http://127.0.0.1:8080 -d 10 -t 1 -c 200\nRunning 10s test @ http://127.0.0.1:8080\n  1 threads and 200 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency     1.70ms  812.42us  20.17ms   97.94%\n    Req/Sec   117.65k     7.52k  123.40k    88.00%\n  1171118 requests in 10.08s, 115.04MB read\nRequests/sec: 116181.73\nTransfer/sec:     11.41MB\n```\n\n## Benchmarks\n\nOne of the fastest web frameworks available according to the [TechEmpower Framework Benchmark](https://www.techempower.com/benchmarks/#section=data-r22\u0026test=composite\u0026hw=ph).\n\n# License\n\nThis project is licensed under either of\n\n * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or\n   http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or\n   http://opensource.org/licenses/MIT)\n\nat your option.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FXudong-Huang%2Fmay_minihttp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FXudong-Huang%2Fmay_minihttp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FXudong-Huang%2Fmay_minihttp/lists"}