A modern C++20 HTTP/HTTPS client library with coroutine-based async/await API.
- ✅ HTTP/HTTPS support with SSL/TLS
- ✅ C++20 coroutines for async operations
- ✅ Connection pooling with Keep-Alive
- ✅ Automatic redirects and compression
- ✅ Retry policies with exponential backoff
- ✅ Rate limiting and timeout control
- ✅ Proxy support (HTTP/HTTPS/SOCKS5)
- ✅ Server-Sent Events (SSE) streaming
- ✅ Header-only library
#include <coro_http/coro_http.hpp>
int main() {
asio::io_context io_ctx;
coro_http::CoroHttpClient client(io_ctx);
client.run([&]() -> asio::awaitable<void> {
auto response = co_await client.co_get("https://api.github.com/users/github");
std::cout << "Status: " << response.status_code() << "\n";
});
return 0;
}coro_http::HttpRequest request(coro_http::HttpMethod::GET, "https://example.com/events");
request.add_header("Accept", "text/event-stream");
co_await client.co_stream_events(request, [](const coro_http::SseEvent& event) {
std::cout << "Event type: " << event.type << "\n";
std::cout << "Data: " << event.data << "\n";
});- C++20 compiler
- CMake 3.20+
- OpenSSL, zlib
git clone https://github.com/harvestsure/coro-http.git
cd coro-http
mkdir build && cd build
cmake ..
makeFor detailed documentation, see:
- API Reference - Complete API documentation
- SSE Support - Server-Sent Events guide
- Examples - Detailed examples
- Features - Feature descriptions
- Configuration - Advanced configuration
MIT License