{"id":28459908,"url":"https://github.com/pimalaya/io-http","last_synced_at":"2025-07-02T12:31:29.060Z","repository":{"id":288288976,"uuid":"946570916","full_name":"pimalaya/io-http","owner":"pimalaya","description":"Set of I/O-free Rust coroutines to manage HTTP streams","archived":false,"fork":false,"pushed_at":"2025-06-04T09:03:46.000Z","size":25,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-07T01:39:16.062Z","etag":null,"topics":["coroutine","http","https","io-free","library","rust","sans-io","stream","tcp"],"latest_commit_sha":null,"homepage":"https://docs.rs/io-http/latest/io_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/pimalaya.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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},"funding":{"github":"soywod","ko_fi":"soywod","buy_me_a_coffee":"soywod","liberapay":"soywod","thanks_dev":"soywod","custom":"https://www.paypal.com/paypalme/soywod"}},"created_at":"2025-03-11T10:51:23.000Z","updated_at":"2025-06-04T09:03:48.000Z","dependencies_parsed_at":"2025-04-16T22:53:50.238Z","dependency_job_id":"d1888f73-4687-42c5-8182-b2c679ea50e0","html_url":"https://github.com/pimalaya/io-http","commit_stats":null,"previous_names":["pimalaya/http","pimalaya/io-http"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/pimalaya/io-http","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pimalaya%2Fio-http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pimalaya%2Fio-http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pimalaya%2Fio-http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pimalaya%2Fio-http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pimalaya","download_url":"https://codeload.github.com/pimalaya/io-http/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pimalaya%2Fio-http/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263140274,"owners_count":23419846,"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":["coroutine","http","https","io-free","library","rust","sans-io","stream","tcp"],"created_at":"2025-06-07T01:39:15.905Z","updated_at":"2025-07-02T12:31:29.051Z","avatar_url":"https://github.com/pimalaya.png","language":"Rust","funding_links":["https://github.com/sponsors/soywod","https://ko-fi.com/soywod","https://buymeacoffee.com/soywod","https://liberapay.com/soywod","https://thanks.dev/soywod","https://www.paypal.com/paypalme/soywod","https://www.buymeacoffee.com/soywod","https://img.shields.io/badge/-thanks.dev-000000?logo=data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQuMDk3IiBoZWlnaHQ9IjE3LjU5NyIgY2xhc3M9InctMzYgbWwtMiBsZzpteC0wIHByaW50Om14LTAgcHJpbnQ6aW52ZXJ0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik05Ljc4MyAxNy41OTdINy4zOThjLTEuMTY4IDAtMi4wOTItLjI5Ny0yLjc3My0uODktLjY4LS41OTMtMS4wMi0xLjQ2Mi0xLjAyLTIuNjA2di0xLjM0NmMwLTEuMDE4LS4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MTU0LS42ODIuMTU0LTEuMTUydi0xLjAyYzAtLjg2OC4yNDgtMS41ODYuNzQ1LTIuMTU1LjQ5Ny0uNTcgMS4xNTgtMS4wMDQgMS45ODMtMS4zMDV2LS4yMTdjLS44MjUtLjMwMS0xLjQ4Ni0uNzM2LTEuOTgzLTEuMzA1LS40OTctLjU3LS43NDUtMS4yODgtLjc0NS0yLjE1NXYtMS4wMmMwLS40Ny0uMDUxLS44NTQtLjE1NC0xLjE1Mi0uMTAyLS4yOTgtLjI1Ni0uNTI2LS40Ni0uNjgyYTEuNzE5IDEuNzE5IDAgMCAwLS43MzctLjMwNyA1LjM5NSA1LjM5NSAwIDAgMC0uOTgtLjA4MmgtLjk4NFYwaDIuMzg0YzEuMTY5IDAgMi4wOTMuMjk3IDIuNzc0Ljg5LjY4LjU5MyAxLjAyIDEuNDYyIDEuMDIgMi42MDZ2MS4zNDZjMCAxLjAxOC4yMjYgMS43NS42NzggMi4xOTUuNDUxLjQ0NiAxLjIzMS42NjggMi4zNC42NjhoLjU4N3oiIGZpbGw9IiNmZmYiLz48L3N2Zz4="],"categories":[],"sub_categories":[],"readme":"# I/O HTTP [![Documentation](https://img.shields.io/docsrs/io-http)](https://docs.rs/io-http/latest/io_http) [![Matrix](https://img.shields.io/matrix/pimalaya:matrix.org?color=success\u0026label=chat)](https://matrix.to/#/#pimalaya:matrix.org)\n\nSet of **I/O-free** Rust coroutines to manage HTTP streams, based on [io-stream](https://github.com/pimalaya/io-stream).\n\nThis library allows you to manage HTTP streams using an I/O-agnostic approach, based on 3 concepts:\n\n### Coroutine\n\nA coroutine is an *I/O-free*, *resumable* and *composable* state machine that **emits I/O requests**. A coroutine is considered *terminated* when it does not emit I/O requests anymore.\n\n*See available coroutines at [./src/coroutines](https://github.com/pimalaya/io-http/tree/master/src).*\n\n### Runtime\n\nA runtime contains all the I/O logic, and is responsible for **processing I/O requests** emitted by coroutines.\n\n*See available runtimes at [io-stream](https://github.com/pimalaya/io-stream/tree/master/src/runtimes).*\n\n### Loop\n\nThe loop is the glue between coroutines and runtimes. It makes the coroutine progress while allowing runtime to process I/O.\n\n## Examples\n\n*See complete examples at [./examples](https://github.com/pimalaya/io-http/blob/master/examples).*\n\n### Send HTTPS request via rustls synchronously\n\n```rust,ignore\nuse std::{net::TcpStream, sync::Arc};\n\nuse io_http::{coroutines::Send, Request};\nuse io_stream::runtimes::std::handle;\nuse rustls::{ClientConfig, ClientConnection, StreamOwned};\nuse rustls_platform_verifier::ConfigVerifierExt;\n\n// build TLS stream\nlet domain = \"github.com\"\nlet config = ClientConfig::with_platform_verifier();\nlet server_name = domain.to_string().try_into().unwrap();\nlet conn = ClientConnection::new(Arc::new(config), server_name).unwrap();\nlet tcp = TcpStream::connect((domain, 443)).unwrap();\nlet tls = StreamOwned::new(conn, tcp);\n\n// send request send receive response\nlet request = Request::new(\"GET\", \"/\", \"1.0\").body(\"\");\n\nlet mut arg = None;\nlet mut send = Send::new(request);\n\nlet response = loop {\n    match send.next() {\n        Ok(response) =\u003e break response,\n        Err(io) =\u003e arg = Some(handle(\u0026mut stream, io).unwrap()),\n    }\n};\n```\n\n*See complete example at [./examples/send.rs](https://github.com/pimalaya/io-http/blob/master/examples/send.rs).*\n\n```rust\ncargo run --example send\n```\n\n### More examples\n\nHave a look at projects built on the top of this library:\n\n- *TODO*\n\n## Sponsoring\n\n[![nlnet](https://nlnet.nl/logo/banner-160x60.png)](https://nlnet.nl/)\n\nSpecial thanks to the [NLnet foundation](https://nlnet.nl/) and the [European Commission](https://www.ngi.eu/) that helped the project to receive financial support from various programs:\n\n- [NGI Assure](https://nlnet.nl/project/Himalaya/) in 2022\n- [NGI Zero Entrust](https://nlnet.nl/project/Pimalaya/) in 2023\n- [NGI Zero Core](https://nlnet.nl/project/Pimalaya-PIM/) in 2024 *(still ongoing)*\n\nIf you appreciate the project, feel free to donate using one of the following providers:\n\n[![GitHub](https://img.shields.io/badge/-GitHub%20Sponsors-fafbfc?logo=GitHub%20Sponsors)](https://github.com/sponsors/soywod)\n[![Ko-fi](https://img.shields.io/badge/-Ko--fi-ff5e5a?logo=Ko-fi\u0026logoColor=ffffff)](https://ko-fi.com/soywod)\n[![Buy Me a Coffee](https://img.shields.io/badge/-Buy%20Me%20a%20Coffee-ffdd00?logo=Buy%20Me%20A%20Coffee\u0026logoColor=000000)](https://www.buymeacoffee.com/soywod)\n[![Liberapay](https://img.shields.io/badge/-Liberapay-f6c915?logo=Liberapay\u0026logoColor=222222)](https://liberapay.com/soywod)\n[![thanks.dev](https://img.shields.io/badge/-thanks.dev-000000?logo=data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQuMDk3IiBoZWlnaHQ9IjE3LjU5NyIgY2xhc3M9InctMzYgbWwtMiBsZzpteC0wIHByaW50Om14LTAgcHJpbnQ6aW52ZXJ0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik05Ljc4MyAxNy41OTdINy4zOThjLTEuMTY4IDAtMi4wOTItLjI5Ny0yLjc3My0uODktLjY4LS41OTMtMS4wMi0xLjQ2Mi0xLjAyLTIuNjA2di0xLjM0NmMwLTEuMDE4LS4yMjctMS43NS0uNjc4LTIuMTk1LS40NTItLjQ0Ni0xLjIzMi0uNjY5LTIuMzQtLjY2OUgwVjcuNzA1aC41ODdjMS4xMDggMCAxLjg4OC0uMjIyIDIuMzQtLjY2OC40NTEtLjQ0Ni42NzctMS4xNzcuNjc3LTIuMTk1VjMuNDk2YzAtMS4xNDQuMzQtMi4wMTMgMS4wMjEtMi42MDZDNS4zMDUuMjk3IDYuMjMgMCA3LjM5OCAwaDIuMzg1djEuOTg3aC0uOTg1Yy0uMzYxIDAtLjY4OC4wMjctLjk4LjA4MmExLjcxOSAxLjcxOSAwIDAgMC0uNzM2LjMwN2MtLjIwNS4xNTYtLjM1OC4zODQtLjQ2LjY4Mi0uMTAzLjI5OC0uMTU0LjY4Mi0uMTU0IDEuMTUxVjUuMjNjMCAuODY3LS4yNDkgMS41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EuNDYyIDEuMDIgMi42MDZ2MS4zNDZjMCAxLjAxOC4yMjYgMS43NS42NzggMi4xOTUuNDUxLjQ0NiAxLjIzMS42NjggMi4zNC42NjhoLjU4N3oiIGZpbGw9IiNmZmYiLz48L3N2Zz4=)](https://thanks.dev/soywod)\n[![PayPal](https://img.shields.io/badge/-PayPal-0079c1?logo=PayPal\u0026logoColor=ffffff)](https://www.paypal.com/paypalme/soywod)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpimalaya%2Fio-http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpimalaya%2Fio-http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpimalaya%2Fio-http/lists"}