[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-6347":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":41,"readmeContent":42,"aiSummary":43,"trendingCount":16,"starSnapshotCount":16,"syncStatus":44,"lastSyncTime":45,"discoverSource":46},6347,"libhv","ithewei\u002Flibhv","ithewei","🔥 比libevent\u002Flibuv\u002Fasio更易用的网络库。A c\u002Fc++ network library for developing TCP\u002FUDP\u002FSSL\u002FHTTP\u002FWebSocket\u002FMQTT client\u002Fserver.","https:\u002F\u002Fgithub.com\u002Fithewei\u002Flibhv\u002Fwiki",null,"C",7516,1357,139,36,0,5,18,1,69.7,"BSD 3-Clause \"New\" or \"Revised\" License",false,"master",true,[26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],"curl","epoll","http-client","http-server","https","iocp","kcp","mqtt","openssl","requests","webserver","websocket","websocket-client","websocket-server","wrk","2026-06-12 04:00:28","English | [中文](README-CN.md)\n\n# libhv\n\n[![Linux](https:\u002F\u002Fbadgen.net\u002Fbadge\u002FLinux\u002Fsuccess\u002Fgreen?icon=github)](https:\u002F\u002Fgithub.com\u002Fithewei\u002Flibhv\u002Factions\u002Fworkflows\u002FCI.yml?query=branch%3Amaster)\n[![Windows](https:\u002F\u002Fbadgen.net\u002Fbadge\u002FWindows\u002Fsuccess\u002Fgreen?icon=github)](https:\u002F\u002Fgithub.com\u002Fithewei\u002Flibhv\u002Factions\u002Fworkflows\u002FCI.yml?query=branch%3Amaster)\n[![macOS](https:\u002F\u002Fbadgen.net\u002Fbadge\u002FmacOS\u002Fsuccess\u002Fgreen?icon=github)](https:\u002F\u002Fgithub.com\u002Fithewei\u002Flibhv\u002Factions\u002Fworkflows\u002FCI.yml?query=branch%3Amaster)\n[![Android](https:\u002F\u002Fbadgen.net\u002Fbadge\u002FAndroid\u002Fsuccess\u002Fgreen?icon=github)](https:\u002F\u002Fgithub.com\u002Fithewei\u002Flibhv\u002Factions\u002Fworkflows\u002FCI.yml?query=branch%3Amaster)\n[![iOS](https:\u002F\u002Fbadgen.net\u002Fbadge\u002FiOS\u002Fsuccess\u002Fgreen?icon=github)](https:\u002F\u002Fgithub.com\u002Fithewei\u002Flibhv\u002Factions\u002Fworkflows\u002FCI.yml?query=branch%3Amaster)\n[![benchmark](https:\u002F\u002Fgithub.com\u002Fithewei\u002Flibhv\u002Fworkflows\u002Fbenchmark\u002Fbadge.svg?branch=master)](https:\u002F\u002Fgithub.com\u002Fithewei\u002Flibhv\u002Factions\u002Fworkflows\u002Fbenchmark.yml?query=branch%3Amaster)\n\u003Cbr>\n[![release](https:\u002F\u002Fbadgen.net\u002Fgithub\u002Frelease\u002Fithewei\u002Flibhv?icon=github)](https:\u002F\u002Fgithub.com\u002Fithewei\u002Flibhv\u002Freleases)\n[![stars](https:\u002F\u002Fbadgen.net\u002Fgithub\u002Fstars\u002Fithewei\u002Flibhv?icon=github)](https:\u002F\u002Fgithub.com\u002Fithewei\u002Flibhv\u002Fstargazers)\n[![forks](https:\u002F\u002Fbadgen.net\u002Fgithub\u002Fforks\u002Fithewei\u002Flibhv?icon=github)](https:\u002F\u002Fgithub.com\u002Fithewei\u002Flibhv\u002Fforks)\n[![issues](https:\u002F\u002Fbadgen.net\u002Fgithub\u002Fissues\u002Fithewei\u002Flibhv?icon=github)](https:\u002F\u002Fgithub.com\u002Fithewei\u002Flibhv\u002Fissues)\n[![PRs](https:\u002F\u002Fbadgen.net\u002Fgithub\u002Fprs\u002Fithewei\u002Flibhv?icon=github)](https:\u002F\u002Fgithub.com\u002Fithewei\u002Flibhv\u002Fpulls)\n[![contributors](https:\u002F\u002Fbadgen.net\u002Fgithub\u002Fcontributors\u002Fithewei\u002Flibhv?icon=github)](https:\u002F\u002Fgithub.com\u002Fithewei\u002Flibhv\u002Fcontributors)\n[![license](https:\u002F\u002Fbadgen.net\u002Fgithub\u002Flicense\u002Fithewei\u002Flibhv?icon=github)](LICENSE)\n\u003Cbr>\n[![gitee](https:\u002F\u002Fbadgen.net\u002Fbadge\u002Fmirror\u002Fgitee\u002Fred)](https:\u002F\u002Fgitee.com\u002Flibhv\u002Flibhv)\n[![awesome-c](https:\u002F\u002Fbadgen.net\u002Fbadge\u002Ficon\u002Fawesome-c\u002Fpink?icon=awesome&label&color)](https:\u002F\u002Fgithub.com\u002Foz123\u002Fawesome-c)\n[![awesome-cpp](https:\u002F\u002Fbadgen.net\u002Fbadge\u002Ficon\u002Fawesome-cpp\u002Fpink?icon=awesome&label&color)](https:\u002F\u002Fgithub.com\u002Ffffaraz\u002Fawesome-cpp)\n\nLike `libevent, libev, and libuv`,\n`libhv` provides event-loop with non-blocking IO and timer,\nbut simpler api and richer protocols.\n\n## ✨ Features\n\n- Cross-platform (Linux, Windows, macOS, Android, iOS, BSD, Solaris)\n- High-performance EventLoop (IO, timer, idle, custom, signal)\n- TCP\u002FUDP client\u002Fserver\u002Fproxy\n- TCP supports heartbeat, reconnect, upstream, MultiThread-safe write and close, etc.\n- Built-in common unpacking modes (FixedLength, Delimiter, LengthField)\n- RUDP support: WITH_KCP\n- SSL\u002FTLS support: (via WITH_OPENSSL or WITH_GNUTLS or WITH_MBEDTLS)\n- HTTP client\u002Fserver (support https http1\u002Fx http2 grpc)\n- HTTP supports static service, indexof service, forward\u002Freverse proxy service, sync\u002Fasync API handler\n- HTTP supports RESTful, router, middleware, keep-alive, chunked, SSE, etc.\n- WebSocket client\u002Fserver\n- MQTT client\n\n## ⌛️ Build\n\nsee [BUILD.md](BUILD.md)\n\nMakefile:\n```shell\n.\u002Fconfigure\nmake\nsudo make install\n```\n\nor cmake:\n```shell\nmkdir build\ncd build\ncmake ..\ncmake --build .\n```\n\nor bazel:\n```shell\nbazel build libhv\n```\n\nor vcpkg:\n```shell\nvcpkg install libhv\n```\n\nor xmake:\n```shell\nxrepo install libhv\n```\n\n## ⚡️ Getting Started\n\nrun `.\u002Fgetting_started.sh`:\n\n```shell\ngit clone https:\u002F\u002Fgithub.com\u002Fithewei\u002Flibhv.git\ncd libhv\n.\u002Fconfigure\nmake\n\nbin\u002Fhttpd -h\nbin\u002Fhttpd -d\n#bin\u002Fhttpd -c etc\u002Fhttpd.conf -s restart -d\nps aux | grep httpd\n\n# http file service\nbin\u002Fcurl -v localhost:8080\n\n# http indexof service\nbin\u002Fcurl -v localhost:8080\u002Fdownloads\u002F\n\n# http api service\nbin\u002Fcurl -v localhost:8080\u002Fping\nbin\u002Fcurl -v localhost:8080\u002Fecho -d \"hello,world!\"\nbin\u002Fcurl -v localhost:8080\u002Fquery?page_no=1\\&page_size=10\nbin\u002Fcurl -v localhost:8080\u002Fkv   -H \"Content-Type:application\u002Fx-www-form-urlencoded\" -d 'user=admin&pswd=123456'\nbin\u002Fcurl -v localhost:8080\u002Fjson -H \"Content-Type:application\u002Fjson\" -d '{\"user\":\"admin\",\"pswd\":\"123456\"}'\nbin\u002Fcurl -v localhost:8080\u002Fform -F 'user=admin' -F 'pswd=123456'\nbin\u002Fcurl -v localhost:8080\u002Fupload -d \"@LICENSE\"\nbin\u002Fcurl -v localhost:8080\u002Fupload -F \"file=@LICENSE\"\n\nbin\u002Fcurl -v localhost:8080\u002Ftest -H \"Content-Type:application\u002Fx-www-form-urlencoded\" -d 'bool=1&int=123&float=3.14&string=hello'\nbin\u002Fcurl -v localhost:8080\u002Ftest -H \"Content-Type:application\u002Fjson\" -d '{\"bool\":true,\"int\":123,\"float\":3.14,\"string\":\"hello\"}'\nbin\u002Fcurl -v localhost:8080\u002Ftest -F 'bool=1' -F 'int=123' -F 'float=3.14' -F 'string=hello'\n# RESTful API: \u002Fgroup\u002F:group_name\u002Fuser\u002F:user_id\nbin\u002Fcurl -v -X DELETE localhost:8080\u002Fgroup\u002Ftest\u002Fuser\u002F123\n\n# benchmark\nbin\u002Fwrk -c 1000 -d 10 -t 4 http:\u002F\u002F127.0.0.1:8080\u002F\n```\n\n### TCP\n#### tcp server\n**c version**: [examples\u002Ftcp_echo_server.c](examples\u002Ftcp_echo_server.c)\n\n**c++ version**: [evpp\u002FTcpServer_test.cpp](evpp\u002FTcpServer_test.cpp)\n```c++\n#include \"TcpServer.h\"\nusing namespace hv;\n\nint main() {\n    int port = 1234;\n    TcpServer srv;\n    int listenfd = srv.createsocket(port);\n    if (listenfd \u003C 0) {\n        return -1;\n    }\n    printf(\"server listen on port %d, listenfd=%d ...\\n\", port, listenfd);\n    srv.onConnection = [](const SocketChannelPtr& channel) {\n        std::string peeraddr = channel->peeraddr();\n        if (channel->isConnected()) {\n            printf(\"%s connected! connfd=%d\\n\", peeraddr.c_str(), channel->fd());\n        } else {\n            printf(\"%s disconnected! connfd=%d\\n\", peeraddr.c_str(), channel->fd());\n        }\n    };\n    srv.onMessage = [](const SocketChannelPtr& channel, Buffer* buf) {\n        \u002F\u002F echo\n        channel->write(buf);\n    };\n    srv.setThreadNum(4);\n    srv.start();\n\n    \u002F\u002F press Enter to stop\n    while (getchar() != '\\n');\n    return 0;\n}\n```\n\n#### tcp client\n**c version**: [examples\u002Ftcp_client_test.c](examples\u002Ftcp_client_test.c)\n\n**c++ version**: [evpp\u002FTcpClient_test.cpp](evpp\u002FTcpClient_test.cpp)\n```c++\n#include \u003Ciostream>\n#include \"TcpClient.h\"\nusing namespace hv;\n\nint main() {\n    int port = 1234;\n    TcpClient cli;\n    int connfd = cli.createsocket(port);\n    if (connfd \u003C 0) {\n        return -1;\n    }\n    cli.onConnection = [](const SocketChannelPtr& channel) {\n        std::string peeraddr = channel->peeraddr();\n        if (channel->isConnected()) {\n            printf(\"connected to %s! connfd=%d\\n\", peeraddr.c_str(), channel->fd());\n        } else {\n            printf(\"disconnected to %s! connfd=%d\\n\", peeraddr.c_str(), channel->fd());\n        }\n    };\n    cli.onMessage = [](const SocketChannelPtr& channel, Buffer* buf) {\n        printf(\"\u003C %.*s\\n\", (int)buf->size(), (char*)buf->data());\n    };\n    cli.start();\n\n    std::string str;\n    while (std::getline(std::cin, str)) {\n        if (str == \"close\") {\n            cli.closesocket();\n        } else if (str == \"start\") {\n            cli.start();\n        } else if (str == \"stop\") {\n            cli.stop();\n            break;\n        } else {\n            if (!cli.isConnected()) break;\n            cli.send(str);\n        }\n    }\n    return 0;\n}\n```\n\n### HTTP\n#### http server\nsee [examples\u002Fhttp_server_test.cpp](examples\u002Fhttp_server_test.cpp)\n\n**golang gin style**\n```c++\n#include \"HttpServer.h\"\nusing namespace hv;\n\nint main() {\n    HttpService router;\n    router.GET(\"\u002Fping\", [](HttpRequest* req, HttpResponse* resp) {\n        return resp->String(\"pong\");\n    });\n\n    router.GET(\"\u002Fdata\", [](HttpRequest* req, HttpResponse* resp) {\n        static char data[] = \"0123456789\";\n        return resp->Data(data, 10);\n    });\n\n    router.GET(\"\u002Fpaths\", [&router](HttpRequest* req, HttpResponse* resp) {\n        return resp->Json(router.Paths());\n    });\n\n    router.GET(\"\u002Fget\", [](HttpRequest* req, HttpResponse* resp) {\n        resp->json[\"origin\"] = req->client_addr.ip;\n        resp->json[\"url\"] = req->url;\n        resp->json[\"args\"] = req->query_params;\n        resp->json[\"headers\"] = req->headers;\n        return 200;\n    });\n\n    router.POST(\"\u002Fecho\", [](const HttpContextPtr& ctx) {\n        return ctx->send(ctx->body(), ctx->type());\n    });\n\n    HttpServer server(&router);\n    server.setPort(8080);\n    server.setThreadNum(4);\n    server.run();\n    return 0;\n}\n```\n#### http client\nsee [examples\u002Fhttp_client_test.cpp](examples\u002Fhttp_client_test.cpp)\n\n**python requests style**\n```c++\n#include \"requests.h\"\n\nint main() {\n    auto resp = requests::get(\"http:\u002F\u002Fwww.example.com\");\n    if (resp == NULL) {\n        printf(\"request failed!\\n\");\n    } else {\n        printf(\"%s\\n\", resp->body.c_str());\n    }\n\n    resp = requests::post(\"127.0.0.1:8080\u002Fecho\", \"hello,world!\");\n    if (resp == NULL) {\n        printf(\"request failed!\\n\");\n    } else {\n        printf(\"%s\\n\", resp->body.c_str());\n    }\n\n    return 0;\n}\n```\n\n### WebSocket\n#### WebSocket server\nsee [examples\u002Fwebsocket_server_test.cpp](examples\u002Fwebsocket_server_test.cpp)\n```c++\n#include \"WebSocketServer.h\"\nusing namespace hv;\n\nint main(int argc, char** argv) {\n    WebSocketService ws;\n    ws.onopen = [](const WebSocketChannelPtr& channel, const HttpRequestPtr& req) {\n        printf(\"onopen: GET %s\\n\", req->Path().c_str());\n    };\n    ws.onmessage = [](const WebSocketChannelPtr& channel, const std::string& msg) {\n        printf(\"onmessage: %.*s\\n\", (int)msg.size(), msg.data());\n    };\n    ws.onclose = [](const WebSocketChannelPtr& channel) {\n        printf(\"onclose\\n\");\n    };\n\n    WebSocketServer server(&ws);\n    server.setPort(9999);\n    server.setThreadNum(4);\n    server.run();\n    return 0;\n}\n```\n\n#### WebSocket client\nsee [examples\u002Fwebsocket_client_test.cpp](examples\u002Fwebsocket_client_test.cpp)\n```c++\n#include \"WebSocketClient.h\"\nusing namespace hv;\n\nint main(int argc, char** argv) {\n    WebSocketClient ws;\n    ws.onopen = []() {\n        printf(\"onopen\\n\");\n    };\n    ws.onmessage = [](const std::string& msg) {\n        printf(\"onmessage: %.*s\\n\", (int)msg.size(), msg.data());\n    };\n    ws.onclose = []() {\n        printf(\"onclose\\n\");\n    };\n\n    \u002F\u002F reconnect: 1,2,4,8,10,10,10...\n    reconn_setting_t reconn;\n    reconn_setting_init(&reconn);\n    reconn.min_delay = 1000;\n    reconn.max_delay = 10000;\n    reconn.delay_policy = 2;\n    ws.setReconnect(&reconn);\n\n    ws.open(\"ws:\u002F\u002F127.0.0.1:9999\u002Ftest\");\n\n    std::string str;\n    while (std::getline(std::cin, str)) {\n        if (!ws.isConnected()) break;\n        if (str == \"quit\") {\n            ws.close();\n            break;\n        }\n        ws.send(str);\n    }\n\n    return 0;\n}\n```\n\n## 🍭 More examples\n### c version\n- [examples\u002Fhloop_test.c](examples\u002Fhloop_test.c)\n- [examples\u002Fhtimer_test.c](examples\u002Fhtimer_test.c)\n- [examples\u002Fpipe_test.c](examples\u002Fpipe_test.c)\n- [examples\u002Ftcp_echo_server.c](examples\u002Ftcp_echo_server.c)\n- [examples\u002Ftcp_chat_server.c](examples\u002Ftcp_chat_server.c)\n- [examples\u002Ftcp_proxy_server.c](examples\u002Ftcp_proxy_server.c)\n- [examples\u002Fudp_echo_server.c](examples\u002Fudp_echo_server.c)\n- [examples\u002Fudp_proxy_server.c](examples\u002Fudp_proxy_server.c)\n- [examples\u002Fsocks5_proxy_server.c](examples\u002Fsocks5_proxy_server.c)\n- [examples\u002Ftinyhttpd.c](examples\u002Ftinyhttpd.c)\n- [examples\u002Ftinyproxyd.c](examples\u002Ftinyproxyd.c)\n- [examples\u002Fjsonrpc](examples\u002Fjsonrpc)\n- [examples\u002Fmqtt](examples\u002Fmqtt)\n- [examples\u002Fmulti-thread\u002Fmulti-acceptor-processes.c](examples\u002Fmulti-thread\u002Fmulti-acceptor-processes.c)\n- [examples\u002Fmulti-thread\u002Fmulti-acceptor-threads.c](examples\u002Fmulti-thread\u002Fmulti-acceptor-threads.c)\n- [examples\u002Fmulti-thread\u002Fone-acceptor-multi-workers.c](examples\u002Fmulti-thread\u002Fone-acceptor-multi-workers.c)\n\n### c++ version\n- [evpp\u002FEventLoop_test.cpp](evpp\u002FEventLoop_test.cpp)\n- [evpp\u002FEventLoopThread_test.cpp](evpp\u002FEventLoopThread_test.cpp)\n- [evpp\u002FEventLoopThreadPool_test.cpp](evpp\u002FEventLoopThreadPool_test.cpp)\n- [evpp\u002FTimerThread_test.cpp](evpp\u002FTimerThread_test.cpp)\n- [evpp\u002FTcpServer_test.cpp](evpp\u002FTcpServer_test.cpp)\n- [evpp\u002FTcpClient_test.cpp](evpp\u002FTcpClient_test.cpp)\n- [evpp\u002FUdpServer_test.cpp](evpp\u002FUdpServer_test.cpp)\n- [evpp\u002FUdpClient_test.cpp](evpp\u002FUdpClient_test.cpp)\n- [examples\u002Fhttp_server_test.cpp](examples\u002Fhttp_server_test.cpp)\n- [examples\u002Fhttp_client_test.cpp](examples\u002Fhttp_client_test.cpp)\n- [examples\u002Fwebsocket_server_test.cpp](examples\u002Fwebsocket_server_test.cpp)\n- [examples\u002Fwebsocket_client_test.cpp](examples\u002Fwebsocket_client_test.cpp)\n- [examples\u002Fprotorpc](examples\u002Fprotorpc)\n- [hv-projects\u002FQtDemo](https:\u002F\u002Fgithub.com\u002Fhv-projects\u002FQtDemo)\n\n### simulate well-known command line tools\n- [examples\u002Fnc](examples\u002Fnc.c)\n- [examples\u002Fnmap](examples\u002Fnmap)\n- [examples\u002Fhttpd](examples\u002Fhttpd)\n- [examples\u002Fwrk](examples\u002Fwrk.cpp)\n- [examples\u002Fcurl](examples\u002Fcurl.cpp)\n- [examples\u002Fwget](examples\u002Fwget.cpp)\n- [examples\u002Fconsul](examples\u002Fconsul)\n- [examples\u002Fkcptun](examples\u002Fkcptun)\n\n## 🥇 Benchmark\n### `pingpong echo-servers`\n```shell\ncd echo-servers\n.\u002Fbuild.sh\n.\u002Fbenchmark.sh\n```\n\n**throughput**:\n```shell\nlibevent running on port 2001\nlibev running on port 2002\nlibuv running on port 2003\nlibhv running on port 2004\nasio running on port 2005\npoco running on port 2006\n\n==============2001=====================================\n[127.0.0.1:2001] 4 threads 1000 connections run 10s\ntotal readcount=1616761 readbytes=1655563264\nthroughput = 157 MB\u002Fs\n\n==============2002=====================================\n[127.0.0.1:2002] 4 threads 1000 connections run 10s\ntotal readcount=2153171 readbytes=2204847104\nthroughput = 210 MB\u002Fs\n\n==============2003=====================================\n[127.0.0.1:2003] 4 threads 1000 connections run 10s\ntotal readcount=1599727 readbytes=1638120448\nthroughput = 156 MB\u002Fs\n\n==============2004=====================================\n[127.0.0.1:2004] 4 threads 1000 connections run 10s\ntotal readcount=2202271 readbytes=2255125504\nthroughput = 215 MB\u002Fs\n\n==============2005=====================================\n[127.0.0.1:2005] 4 threads 1000 connections run 10s\ntotal readcount=1354230 readbytes=1386731520\nthroughput = 132 MB\u002Fs\n\n==============2006=====================================\n[127.0.0.1:2006] 4 threads 1000 connections run 10s\ntotal readcount=1699652 readbytes=1740443648\nthroughput = 165 MB\u002Fs\n```\n\n### `iperf tcp_proxy_server`\n```shell\n# sudo apt install iperf\niperf -s -p 5001 > \u002Fdev\u002Fnull &\nbin\u002Ftcp_proxy_server 1212 127.0.0.1:5001 &\niperf -c 127.0.0.1 -p 5001 -l 8K\niperf -c 127.0.0.1 -p 1212 -l 8K\n```\n\n**Bandwidth**:\n```shell\n------------------------------------------------------------\n[  3] local 127.0.0.1 port 52560 connected with 127.0.0.1 port 5001\n[ ID] Interval       Transfer     Bandwidth\n[  3]  0.0-10.0 sec  20.8 GBytes  17.9 Gbits\u002Fsec\n\n------------------------------------------------------------\n[  3] local 127.0.0.1 port 48142 connected with 127.0.0.1 port 1212\n[ ID] Interval       Transfer     Bandwidth\n[  3]  0.0-10.0 sec  11.9 GBytes  10.2 Gbits\u002Fsec\n```\n\n### `webbench`\n```shell\n# sudo apt install wrk\nwrk -c 100 -t 4 -d 10s http:\u002F\u002F127.0.0.1:8080\u002F\n\n# sudo apt install apache2-utils\nab -c 100 -n 100000 http:\u002F\u002F127.0.0.1:8080\u002F\n```\n\n**libhv(port:8080) vs nginx(port:80)**\n\n![libhv-vs-nginx.png](html\u002Fdownloads\u002Flibhv-vs-nginx.png)\n\nAbove test results can be found on [Github Actions](https:\u002F\u002Fgithub.com\u002Fithewei\u002Flibhv\u002Factions\u002Fworkflows\u002Fbenchmark.yml).\n","libhv 是一个用于开发 TCP\u002FUDP\u002FSSL\u002FHTTP\u002FWebSocket\u002FMQTT 客户端和服务端的 C\u002FC++ 网络库，相比 libevent、libuv 和 asio 更易用。它提供了跨平台支持（包括 Linux、Windows、macOS、Android 和 iOS），高性能事件循环机制，以及丰富的协议支持如 HTTP（含 HTTPS、HTTP\u002F2、gRPC）、WebSocket 和 MQTT 等。此外，libhv 还具备心跳检测、自动重连、多线程安全写入关闭等特性，并且内置了常用的数据解包模式。该库非常适合需要快速构建高效网络应用或服务的场景，特别是在物联网、即时通讯和Web服务领域。",2,"2026-06-11 03:06:35","top_language"]