// the find
ithewei/libhv
🔥 比libevent/libuv/asio更易用的网络库。A c/c++ network library for developing TCP/UDP/SSL/HTTP/WebSocket/MQTT client/server.
libhv is a cross-platform C/C++ networking library built on an event loop, covering TCP/UDP/SSL/HTTP/WebSocket/MQTT with both C and C++ APIs. It targets embedded systems, game servers, and anyone who finds libuv or asio too verbose. The C++ layer wraps the C core with a gin/requests-style API that lowers the barrier considerably.
The dual C/C++ API surface is genuinely useful — you can drop to raw hloop_t for tight control or use TcpServer/HttpServer wrappers without penalty. Built-in unpacking modes (FixedLength, Delimiter, LengthField) solve the framing problem that every TCP newcomer hits and usually gets wrong. The benchmark numbers are credible: echo-server throughput beats libevent and libuv in the included comparison, and the CI workflow actually runs those benchmarks on every push. SSL abstraction supports OpenSSL, GnuTLS, mbedTLS, and platform-native (WinTLS, Apple TLS) through a single hssl.h interface, so you can swap backends without touching application code.
The documentation is heavily Chinese-first — the English README is a translation with gaps, and the API reference (docs/API.md) is a stub. If you hit a subtle bug, you're reading C source or asking in Chinese-language issues. HTTP/2 support exists but is bolted on (Http2Parser.cpp) and not mentioned in the feature list confidently — grpc support is present but limited to a misc/grpc_server.h header with no clear production story. The library has no async/coroutine integration; everything is callback-based, which works but creates deep callback chains in complex protocols. There's also no package on pkg-config or a stable ABI guarantee, so vendoring it into a project means you own the upgrade path.