{"id":50971012,"url":"https://github.com/ferronweb/vibeio-http","last_synced_at":"2026-06-19T02:30:27.647Z","repository":{"id":345554522,"uuid":"1186100744","full_name":"ferronweb/vibeio-http","owner":"ferronweb","description":"High-performance HTTP/1.1, HTTP/2, and experimental HTTP/3 server implementation for the \"vibeio\" async runtime.","archived":false,"fork":false,"pushed_at":"2026-06-14T06:09:05.000Z","size":163,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-14T08:05:56.311Z","etag":null,"topics":["http","rust"],"latest_commit_sha":null,"homepage":"https://docs.rs/vibeio-http","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ferronweb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-19T09:12:36.000Z","updated_at":"2026-06-14T06:09:09.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ferronweb/vibeio-http","commit_stats":null,"previous_names":["ferronweb/vibeio-http"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/ferronweb/vibeio-http","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferronweb%2Fvibeio-http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferronweb%2Fvibeio-http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferronweb%2Fvibeio-http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferronweb%2Fvibeio-http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ferronweb","download_url":"https://codeload.github.com/ferronweb/vibeio-http/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferronweb%2Fvibeio-http/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34515405,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"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","rust"],"created_at":"2026-06-19T02:30:25.393Z","updated_at":"2026-06-19T02:30:27.642Z","avatar_url":"https://github.com/ferronweb.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vibeio-http\n\nHigh-performance HTTP server primitives for the `vibeio` runtime.\n\n`vibeio-http` provides HTTP/1.0, HTTP/1.1, HTTP/2, and experimental HTTP/3\nconnection handlers behind a shared `HttpProtocol` trait. Each handler receives\nan `http::Request\u003cIncoming\u003e` and returns an `http::Response\u003cB\u003e`, where\n`B: http_body::Body\u003cData = bytes::Bytes\u003e`.\n\n## Highlights\n\n- HTTP/1.x, HTTP/2, and HTTP/3 handlers with a common interface\n- Streaming request/response bodies and trailers\n- Automatic `100 Continue` support\n- `103 Early Hints` support via `send_early_hints`\n- HTTP/1 upgrade support (`prepare_upgrade` / `OnUpgrade`)\n- Linux zero-copy response sending for HTTP/1.x (`h1-zerocopy` feature)\n- Graceful shutdown support for all protocol handlers via `CancellationToken`\n\n## Installation\n\n```toml\n[dependencies]\nvibeio-http = \"0.1\"\n```\n\nBy default, this crate enables: `h1`, `h1-zerocopy`, and `h2`.\n\n### Feature flags\n\n- `h1`: HTTP/1.x support\n- `h2`: HTTP/2 support\n- `h3`: HTTP/3 support (experimental, based on the `h3` crate)\n- `h1-zerocopy`: Linux-only zero-copy HTTP/1.x response sending (`splice`-based)\n\nFor a smaller build, disable default features and opt in explicitly:\n\n```toml\n[dependencies]\nvibeio-http = { version = \"0.1\", default-features = false, features = [\"h1\"] }\n```\n\n## Quickstart (HTTP/1.1)\n\n```rust\nuse bytes::Bytes;\nuse http::Response;\nuse http_body_util::Full;\nuse vibeio::net::TcpListener;\nuse vibeio::RuntimeBuilder;\nuse vibeio_http::{Http1, Http1Options, HttpProtocol};\n\nfn main() -\u003e std::io::Result\u003c()\u003e {\n    let runtime = RuntimeBuilder::new().enable_timer(true).build()?;\n\n    runtime.block_on(async {\n        let listener = TcpListener::bind(\"127.0.0.1:8080\")?;\n        loop {\n            let (stream, _) = listener.accept().await?;\n            stream.set_nodelay(true)?;\n            let stream = stream.into_poll()?;\n\n            vibeio::spawn(async move {\n                if let Err(e) = Http1::new(stream, Http1Options::default())\n                    .handle(|_request| async move {\n                        Ok::\u003c_, std::convert::Infallible\u003e(Response::new(Full::new(\n                            Bytes::from_static(b\"Hello World\"),\n                        )))\n                    })\n                    .await\n                {\n                    eprintln!(\"HTTP error: {:?}\", e);\n                }\n            });\n        }\n    })\n}\n```\n\n## Early hints (`103`)\n\nUse `send_early_hints` from your handler before returning the final response.\n\nNotes:\n- HTTP/2 and HTTP/3: available by default\n- HTTP/1.x: requires `Http1Options::enable_early_hints(true)`\n\n```rust\nuse http::{header, HeaderMap, Response};\nuse http_body_util::Empty;\nuse vibeio_http::send_early_hints;\n\nlet handler = |mut req| async move {\n    let mut hints = HeaderMap::new();\n    hints.insert(\n        header::LINK,\n        \"\u003c/app.css\u003e; rel=preload; as=style\".parse().unwrap(),\n    );\n    let _ = send_early_hints(\u0026mut req, hints).await;\n\n    Ok::\u003c_, std::convert::Infallible\u003e(Response::new(Empty::\u003cbytes::Bytes\u003e::new()))\n};\n```\n\n## HTTP/1 options\n\n`Http1Options` supports:\n- request head size and header count limits\n- request head read timeout\n- automatic `Date` header injection\n- automatic `100 Continue`\n- optional `103 Early Hints`\n- vectored write toggle\n\n`Http2Options` and `Http3Options` similarly expose:\n- handshake/accept timeouts\n- automatic `100 Continue`\n- direct access to underlying protocol builders (`h2_builder`, `h3_builder`)\n\n## HTTP/1 upgrades\n\nFor upgrade workflows (for example WebSocket-style handoff), call\n`prepare_upgrade(\u0026mut request)` in your handler and await the returned\n`OnUpgrade` future after sending a `101 Switching Protocols` response.\n\nThe resolved `Upgraded` type implements `tokio::io::AsyncRead + AsyncWrite`.\n\n## Linux zero-copy (HTTP/1.x)\n\nWhen built with `h1-zerocopy` on Linux:\n\n1. Convert your handler with `.zerocopy()`\n2. Mark responses with `unsafe install_zerocopy(response, raw_fd)`\n\nResponses carrying that extension are sent via kernel-assisted transfer. Other\nresponses fall back to normal HTTP/1 writes.\n\n## Graceful shutdown\n\n`Http1`, `Http2`, and `Http3` expose:\n\n```rust,ignore\n.graceful_shutdown_token(token)\n```\n\nCancel the token to stop accepting new work and shut down the connection\ncleanly.\n\n## Crate API at a glance\n\n- `HttpProtocol`: common protocol trait (`handle`, `handle_with_error_fn`)\n- `Incoming`: type-erased request body type used in all handlers\n- `send_early_hints`: send a `103 Early Hints` interim response\n- `Http1` / `Http1Options`\n- `Http2` / `Http2Options`\n- `Http3` / `Http3Options`\n- `prepare_upgrade`, `OnUpgrade`, `Upgraded` (HTTP/1 upgrade flow)\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fferronweb%2Fvibeio-http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fferronweb%2Fvibeio-http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fferronweb%2Fvibeio-http/lists"}