{"id":15047721,"url":"https://github.com/olexiykhokhlov/h2pp","last_synced_at":"2026-04-09T10:52:05.720Z","repository":{"id":247252337,"uuid":"821805553","full_name":"OlexiyKhokhlov/h2pp","owner":"OlexiyKhokhlov","description":"HTTP/2 C++20 client library","archived":false,"fork":false,"pushed_at":"2024-11-02T19:13:06.000Z","size":137,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-20T17:17:19.413Z","etag":null,"topics":["cpp-library","cpp20","cross-platform","http2","http2-client"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OlexiyKhokhlov.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":"2024-06-29T13:39:11.000Z","updated_at":"2024-11-02T20:43:58.000Z","dependencies_parsed_at":"2024-07-27T20:43:13.477Z","dependency_job_id":null,"html_url":"https://github.com/OlexiyKhokhlov/h2pp","commit_stats":null,"previous_names":["olexiykhokhlov/h2pp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OlexiyKhokhlov%2Fh2pp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OlexiyKhokhlov%2Fh2pp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OlexiyKhokhlov%2Fh2pp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OlexiyKhokhlov%2Fh2pp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OlexiyKhokhlov","download_url":"https://codeload.github.com/OlexiyKhokhlov/h2pp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243489778,"owners_count":20298997,"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":["cpp-library","cpp20","cross-platform","http2","http2-client"],"created_at":"2024-09-24T21:03:30.457Z","updated_at":"2025-12-29T10:56:38.466Z","avatar_url":"https://github.com/OlexiyKhokhlov.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Support Ukraine](https://img.shields.io/badge/Support-Ukraine-FFD500?style=flat\u0026labelColor=005BBB)](https://opensource.facebook.com/support-ukraine)\n[![Ubuntu-x64](https://github.com/OlexiyKhokhlov/h2pp/actions/workflows/ubuntu-x64.yml/badge.svg)](https://github.com/OlexiyKhokhlov/h2pp/actions/workflows/ubuntu-x64.yml)\n[![Windows-x64](https://github.com/OlexiyKhokhlov/h2pp/actions/workflows/windows-x64.yml/badge.svg)](https://github.com/OlexiyKhokhlov/h2pp/actions/workflows/windows-x64.yml)\n\n# h2pp - modern C++ HTTP/2 client library\n\nThis is an implementation of HTTP/2 in C++20 that works over [boost asio](https://www.boost.org/doc/libs/1_84_0/doc/html/boost_asio.html)\n\nThe main goal of the library is provide a simple and usefull HTTP/2 client.\n\n## Example\n\nThis is a simple command line application that sends a GET request by the given url.\nA full buildable sample is [here](https://github.com/OlexiyKhokhlov/h2pp/tree/main/examples)\n\n```C++\n#include \u003ciostream\u003e\n#include \u003cthread\u003e\n\n#include \u003cboost/asio/io_context.hpp\u003e\n#include \u003cboost/asio/use_future.hpp\u003e\n#include \u003cboost/url.hpp\u003e\n\n#include \u003cclient_session.h\u003e\n\nboost::asio::io_context io_context;\n\nint main(int argc, char **argv) {\n  if (argc != 2) {\n    std::cerr \u003c\u003c \"Usage: https_client \u003curl\u003e\" \u003c\u003c std::endl;\n    return EXIT_FAILURE;\n  }\n\n  http2::client_session\u003chttp2::connection\u003c\u003e\u003e client(io_context);\n\n  std::jthread iothr([]() {\n    boost::asio::io_context::work work(io_context);\n    io_context.run();\n  });\n\n  try {\n    auto url = boost::urls::parse_uri(argv[1]);\n    if (url.has_error()) {\n      return EXIT_FAILURE;\n    }\n\n    std::string service = url-\u003eport();\n    if (service.empty()) {\n      service = \"443\";\n    }\n\n    client\n        .async_connect(\n            url-\u003ehost_name(), service,\n            [](boost::system::error_code ec) {\n              if (ec) {\n                std::cerr \u003c\u003c \"HTTP2 Client unexpectedly stopped: \" \u003c\u003c ec \u003c\u003c std::endl;\n              }\n            },\n            boost::asio::use_future)\n        .get();\n\n    http2::request request;\n    request.method(http2::method::GET).url(argv[1]).headers({{\"accept\", \"*/*\"}, {\"user-agent\", \"h2pp/0.0.1\"}});\n    auto response = client.async_send(std::move(request), boost::asio::use_future).get();\n    for (const auto \u0026h : response.headers()) {\n      std::cout \u003c\u003c h.name_view() \u003c\u003c \":  \" \u003c\u003c h.value_view() \u003c\u003c std::endl;\n    }\n    std::cout \u003c\u003c response.body_as\u003cstd::string\u003e() \u003c\u003c std::endl;\n\n    client.async_disconnect(boost::asio::use_future).get();\n  } catch (std::exception \u0026e) {\n    std::cerr \u003c\u003c \"Exception: \" \u003c\u003c e.what() \u003c\u003c std::endl;\n  }\n\n  io_context.stop();\n  iothr.join();\n\n  return EXIT_SUCCESS;\n}\n\n```\n\n## Dependencies\n\n- [Boost asio, url, endiannes](https://www.boost.org/);\n- [OpenSSL]( https://www.openssl.org/). An experienced user can use any other equivalent but an integration on you;\n\n## Development status\n\nI've fixed al known bugs so it works...\nBut it isn't so well tested as required to say - release.\nAlso is not implemented:\n - pushes;\n - stream priorities;\n - dynamic settings changing;\n\n## License\n\nDistributed under the [GNU Aferro General Public License  v3.0](https://www.gnu.org/licenses/agpl-3.0.en.html#license-text)\n\nIf need more just ask me. Everything is negotiable.\n\n## Usefull links\n\n- [HTTP/2 Specifications](https://http2.github.io/)\n- [nghttp2 - well known HTTP/2 library in C](https://github.com/nghttp2/nghttp2)\n- [Proxygen: Facebook's C++ HTTP Libraries](https://github.com/facebook/proxygen)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folexiykhokhlov%2Fh2pp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folexiykhokhlov%2Fh2pp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folexiykhokhlov%2Fh2pp/lists"}