{"id":21296251,"url":"https://github.com/co-rs/mco-http","last_synced_at":"2025-07-11T17:31:23.789Z","repository":{"id":57608013,"uuid":"451883867","full_name":"co-rs/mco-http","owner":"co-rs","description":"mco based http server and client","archived":false,"fork":false,"pushed_at":"2023-12-10T08:30:34.000Z","size":816,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-10T07:53:28.172Z","etag":null,"topics":["async","http","http-server","httpclient"],"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/co-rs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-25T13:15:58.000Z","updated_at":"2022-10-11T04:32:28.000Z","dependencies_parsed_at":"2022-09-03T03:03:12.321Z","dependency_job_id":null,"html_url":"https://github.com/co-rs/mco-http","commit_stats":null,"previous_names":["co-rs/cogo-http"],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/co-rs/mco-http","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/co-rs%2Fmco-http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/co-rs%2Fmco-http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/co-rs%2Fmco-http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/co-rs%2Fmco-http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/co-rs","download_url":"https://codeload.github.com/co-rs/mco-http/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/co-rs%2Fmco-http/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264167042,"owners_count":23567006,"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":["async","http","http-server","httpclient"],"created_at":"2024-11-21T14:25:15.102Z","updated_at":"2025-07-11T17:31:23.391Z","avatar_url":"https://github.com/co-rs.png","language":"Rust","readme":"# mco-http\n\n* HTTP framework based on Coroutine library [mco](https://github.com/co-rs/mco),  Original code fork from Hyper，We improved the underlying logic\n* Light weight, high performance\n* support http/https server (see examples)\n* support http/https client (see examples)\n* support route\n* support Interceptor/middleware\n\n## example-server\n```rust\n#[deny(unused_variables)]\nextern crate mco_http;\n\nuse mco_http::route::Route;\nuse mco_http::server::{Request, Response};\n\nfn hello(req: Request, res: Response) {\n    res.send(b\"Hello World!\");\n}\n\nfn main() {\n    let mut route = Route::new();\n    route.handle_fn(\"/\", |req: Request, res: Response| {\n        res.send(b\"Hello World!\");\n    });\n    route.handle_fn(\"/js\", |req: Request, res: Response| {\n        res.send(\"{\\\"name\\\":\\\"joe\\\"}\".as_bytes());\n    });\n    route.handle_fn(\"/fn\", hello);\n    let _listening = mco_http::Server::http(\"0.0.0.0:3000\").unwrap()\n        .handle(hello);\n    println!(\"Listening on http://127.0.0.1:3000\");\n}\n\n```\n\n## example-client\n```rust\nextern crate mco_http;\n\nuse std::io;\nuse mco_http::Client;\nuse mco_http::header::Connection;\n\nfn main() {\n    let mut url = \"http://www.baidu.com\".to_string();\n\n    let client = Client::new();\n\n    let mut res = client.get(\u0026url)\n        .header(Connection::close())\n        .send().unwrap();\n\n    println!(\"Response: {}\", res.status);\n    println!(\"Headers:\\n{}\", res.headers);\n    io::copy(\u0026mut res, \u0026mut io::stdout()).unwrap();\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fco-rs%2Fmco-http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fco-rs%2Fmco-http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fco-rs%2Fmco-http/lists"}