{"id":27388564,"url":"https://github.com/tickbh/wmhttp","last_synced_at":"2026-03-09T07:31:37.501Z","repository":{"id":191757621,"uuid":"685328760","full_name":"tickbh/wmhttp","owner":"tickbh","description":"http1.1/http2 server/client by rust","archived":false,"fork":false,"pushed_at":"2025-02-14T06:51:00.000Z","size":563,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-14T01:27:42.189Z","etag":null,"topics":["client","http","http-client","http-requests","http-server","http2","httpclient","https","server"],"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/tickbh.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-31T01:54:31.000Z","updated_at":"2025-02-14T06:51:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"7a71916d-a5bd-4976-9690-3f5bd36c8d7a","html_url":"https://github.com/tickbh/wmhttp","commit_stats":null,"previous_names":["tickbh/dmeng","tickbh/dianmeng","tickbh/wmhttp","tickbh/wenmeng"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tickbh/wmhttp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tickbh%2Fwmhttp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tickbh%2Fwmhttp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tickbh%2Fwmhttp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tickbh%2Fwmhttp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tickbh","download_url":"https://codeload.github.com/tickbh/wmhttp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tickbh%2Fwmhttp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30287425,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T02:57:19.223Z","status":"ssl_error","status_checked_at":"2026-03-09T02:56:26.373Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["client","http","http-client","http-requests","http-server","http2","httpclient","https","server"],"created_at":"2025-04-13T18:41:17.090Z","updated_at":"2026-03-09T07:31:37.465Z","avatar_url":"https://github.com/tickbh.png","language":"Rust","readme":"# wenmeng\n\n一个包含http1.1及http2的服务器及客户端的实现, 依赖tokio实现\n\n## 使用方法\n\n简单的hello world示例\n\n```rust\nuse std::{env, error::Error};\nuse tokio::net::TcpListener;\nuse webparse::{Request, Response};\nuse wmhttp::{self, ProtResult, RecvStream, Server, RecvRequest};\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), Box\u003cdyn Error\u003e\u003e {\n    let addr = env::args()\n        .nth(1)\n        .unwrap_or_else(|| \"127.0.0.1:8080\".to_string());\n    let server = TcpListener::bind(\u0026addr).await?;\n    println!(\"Listening on: {}\", addr);\n    loop {\n        let (stream, _) = server.accept().await?;\n        tokio::spawn(async move {\n            let mut server = Server::new(stream);\n            async fn operate(req: RecvRequest) -\u003e ProtResult\u003cOption\u003cResponse\u003cString\u003e\u003e\u003e {\n                let response = Response::builder()\n                    .version(req.version().clone())\n                    .body(\"Hello World\".to_string())?;\n                Ok(Some(response))\n            }\n            let _ = server.incoming(operate).await;\n        });\n    }\n}\n```\n\n## 客户端使用方法\n\n\u003e http1/http2通用, recv可以接收多个返回及服务端的推送信息\n```rust\nuse webparse::Request;\nuse wmhttp::{Client, ProtResult};\n\nasync fn test_http2() -\u003e ProtResult\u003c()\u003e {\n    let url = \"http://nghttp2.org/\"; //\"http://127.0.0.1:8080/\"\n    let req = Request::builder().method(\"GET\").url(url).body(\"\").unwrap();\n\n    let client = Client::builder().connect(url).await.unwrap();\n\n    let (mut recv, sender) = client.send2(req.into_type()).await?;\n    let mut res = recv.recv().await.unwrap();\n    res.body_mut().wait_all().await;\n    println!(\"res = {}\", res);\n\n    let req = Request::builder()\n        .method(\"GET\")\n        .url(url.to_owned() + \"blog/\")\n        .body(\"\")\n        .unwrap();\n    sender.send(req.into_type()).await?;\n    let res = recv.recv().await.unwrap();\n    println!(\"res = {}\", res);\n    Ok(())\n}\n```\n\n## License\nApache License, Version 2.0 ([LICENSE-APACHE](./LICENSE) or [https://apache.org/licenses/LICENSE-2.0](https://apache.org/licenses/LICENSE-2.0))","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftickbh%2Fwmhttp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftickbh%2Fwmhttp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftickbh%2Fwmhttp/lists"}