{"id":33002956,"url":"https://github.com/wlgq2/uv-cpp","last_synced_at":"2026-01-25T15:36:48.856Z","repository":{"id":39579917,"uuid":"96177824","full_name":"wlgq2/uv-cpp","owner":"wlgq2","description":"libuv wrapper in C++11 /libuv C++11网络库","archived":false,"fork":false,"pushed_at":"2025-11-13T06:46:27.000Z","size":10772,"stargazers_count":828,"open_issues_count":5,"forks_count":215,"subscribers_count":44,"default_branch":"master","last_synced_at":"2025-11-13T08:34:05.748Z","etag":null,"topics":["libuv","tcp"],"latest_commit_sha":null,"homepage":"","language":"C++","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/wlgq2.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-07-04T05:17:12.000Z","updated_at":"2025-11-13T06:46:32.000Z","dependencies_parsed_at":"2023-12-23T17:01:37.465Z","dependency_job_id":"bb4df364-bf9c-4a0b-8b04-6eba2e3a33de","html_url":"https://github.com/wlgq2/uv-cpp","commit_stats":null,"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"purl":"pkg:github/wlgq2/uv-cpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wlgq2%2Fuv-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wlgq2%2Fuv-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wlgq2%2Fuv-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wlgq2%2Fuv-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wlgq2","download_url":"https://codeload.github.com/wlgq2/uv-cpp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wlgq2%2Fuv-cpp/sbom","scorecard":{"id":1239710,"data":{"date":"2025-11-03","repo":{"name":"github.com/wlgq2/uv-cpp","commit":"f80c2487e03c2409d88f4add53197a575182da1f"},"scorecard":{"version":"v5.3.1-0.20251106164954-c65a663bf4a9","commit":"c65a663bf4a93c0f6eca32e6d34713d3e3440e11"},"score":2.4,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#packaging"}},{"name":"Code-Review","score":1,"reason":"Found 3/20 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":4,"reason":"binaries present in source code","details":["Warn: binary detected: libuv1.30.0/lib/gcc8.3.0/libuv.a:1","Warn: binary detected: libuv1.30.0/lib/gcc8.3.0/libuv.so:1","Warn: binary detected: libuv1.30.0/lib/gcc8.3.0/libuv.so.1:1","Warn: binary detected: libuv1.30.0/lib/gcc8.3.0/libuv.so.1.0.0:1","Warn: binary detected: libuv1.30.0/lib/win_sdk10.0.10240/Debug/libuv.lib:1","Warn: binary detected: libuv1.30.0/lib/win_sdk10.0.10240/Release/libuv.lib:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#fuzzing"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#pinned-dependencies"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 13 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/c65a663bf4a93c0f6eca32e6d34713d3e3440e11/docs/checks.md#sast"}}]},"last_synced_at":"2025-11-13T08:35:04.923Z","repository_id":39579917,"created_at":"2025-11-13T08:35:04.924Z","updated_at":"2025-11-13T08:35:04.924Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28754824,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T13:59:49.818Z","status":"ssl_error","status_checked_at":"2026-01-25T13:59:33.728Z","response_time":113,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["libuv","tcp"],"created_at":"2025-11-13T14:00:38.903Z","updated_at":"2026-01-25T15:36:48.838Z","avatar_url":"https://github.com/wlgq2.png","language":"C++","readme":"# uv-cpp\n\u003ca href=\"https://github.com/wlgq2/uv-cpp/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/release/wlgq2/uv-cpp.svg\" alt=\"Github release\"\u003e\u003c/a\u003e\n[![Platform](https://img.shields.io/badge/platform-%20%20%20%20Linux,%20Windows-green.svg?style=flat)](https://github.com/wlgq2/uv-cpp)\n[![License](https://img.shields.io/badge/license-%20%20MIT-yellow.svg?style=flat)](LICENSE)\n[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active)\n![CodeRabbit Pull Request Reviews](https://img.shields.io/coderabbit/prs/github/wlgq2/uv-cpp?utm_source=oss\u0026utm_medium=github\u0026utm_campaign=wlgq2%2Fuv-cpp\u0026labelColor=171717\u0026color=FF570A\u0026link=https%3A%2F%2Fcoderabbit.ai\u0026label=CodeRabbit+Reviews)\n\n\u003cbr\u003eLanguage Translations:\u003c/br\u003e\n* [English](README.md)\n* [简体中文](README_cn.md)\n** **\nuv-cpp is a simple interface, high-performance network library based on C++11.\n\n## Dependencies\n * [libuv][1]\n## Features\n* C++11 functional/bind style callback instead of C-style function pointer.\n* `TCP` and `UDP` wrapper.\n* `DNS`and`Http`：DNS query and http support，Http routing based on radix tree.\n* `Timer`and`TimerWheel`：Heartbeat timeout judgment with time complexity of O(1).\n* `Async`：libuv async wrapper，but optimized the [problem][2] of calling multiple times  but callback  will only be called once. \n* `Packet`and`PacketBuffer`：Send and receive packet of Tcp data stream. Support custom data packet structure (such as [uvnsq][3])\n* Log interface.\n** **\n## Build Instructions\n* VS2017 (windows)\n* Codeblocks (linux)\n* CMake (linux)\n** **\n## Benchmark\n### ping-pong VS boost.asio-1.67\n\u003cbr\u003eenvironment：Intel Core i5 8265U + debian8 + gcc8.3.0 + libuv1.30.0 + '-O2'\u003c/br\u003e\n\n size peer pack | 1K bytes|2K bytes|4K bytes|8K bytes|\n:---------:|:--------:|:--------:|:--------:|:--------:|\nuv-cpp | 16138 kbyte|32071 kbyte|59264 kbyte|123813 kbyte|\nboost.asio | 16119 kbyte|31566 kbyte|58322 kbyte|126210 kbyte|\n\n![asio1](https://github.com/wlgq2/uv_cpp_res/blob/master/vs_asio/one_no_data.png)\n\n\u003cbr\u003eenvironment：i5-8265U + 4G memory + 4k bytes ping-pong\u003c/br\u003e\nconcurrency| 10|100|1000|5000|\n:---------:|:--------:|:--------:|:--------:|:--------:|\nuv-cpp | 654282 kbyte|591869 kbyte|401500 kbyte|412855 kbyte|\nboost.asio | 633818 kbyte|585716 kbyte|371386 kbyte|382402 kbyte|\n\n![asio2](https://github.com/wlgq2/uv_cpp_res/blob/master/vs_asio/concurrency_no_data.png)\n\n### Apache bench VS nginx-1.14.2\n\u003cbr\u003eenvironment：Intel Core i5 8265U + debian8 + gcc8.3.0 + libuv1.30.0 + '-O2'\u003c/br\u003e\n\u003cbr\u003e1000 concurrency \u0026\u0026 100000 request.\u003c/br\u003e\n![uv_http](https://github.com/wlgq2/uv_cpp_res/blob/master/vs_nginx/uv_http_1000.png)\n![nginx_http](https://github.com/wlgq2/uv_cpp_res/blob/master/vs_nginx/nginx_http_1000.png)\n\n## Quick start\nA simple echo server\n```C++\n#include \u003ciostream\u003e\n#include \u003cuv/include/uv11.h\u003e\n\nint main(int argc, char** args)\n{\n    uv::EventLoop* loop = uv::EventLoop::DefaultLoop();\n\t\n    uv::TcpServer server(loop);\n    server.setMessageCallback([](uv::TcpConnectionPtr ptr,const char* data, ssize_t size)\n    {\n        ptr-\u003ewrite(data, size, nullptr);\n    });\n    //server.setTimeout(60); //heartbeat timeout.\n\t\n    uv::SocketAddr addr(\"0.0.0.0\", 10005, uv::SocketAddr::Ipv4);\n    server.bindAndListen(addr);\n    loop-\u003erun();\n}\n\n```\n\nA simple http service router which based on radix tree.\n```C++\nint main(int argc, char** args)\n{\n    uv::EventLoop loop;\n    uv::http::HttpServer::SetBufferMode(uv::GlobalConfig::BufferMode::CycleBuffer);\n\n    uv::http::HttpServer server(\u0026loop);\n\t\n    //example:  127.0.0.1:10010/test\n    server.Get(\"/test\",std::bind(\u0026func1,std::placeholders::_1,std::placeholders::_2));\n    \n    //example:  127.0.0.1:10010/some123abc\n    server.Get(\"/some*\",std::bind(\u0026func2, std::placeholders::_1, std::placeholders::_2));\n    \n    //example:  127.0.0.1:10010/value:1234\n    server.Get(\"/value:\",std::bind(\u0026func3, std::placeholders::_1, std::placeholders::_2));\n    \n    //example:  127.0.0.1:10010/sum?param1=100\u0026param2=23\n    server.Get(\"/sum\",std::bind(\u0026func4, std::placeholders::_1, std::placeholders::_2));\n    \n    uv::SocketAddr addr(\"127.0.0.1\", 10010);\n    server.bindAndListen(addr);\n    loop.run();\n}\n\n```\nMore examples [here][4].\n\u003cbr\u003eAPI's document [here][5].  \u003c/br\u003e\n\n[1]: https://github.com/libuv/libuv\n[2]: http://docs.libuv.org/en/v1.x/async.html\n[3]: https://github.com/wlgq2/uvnsq\n[4]: https://github.com/wlgq2/uv-cpp/tree/master/examples\n[5]: https://github.com/wlgq2/uv-cpp/tree/master/doc\n","funding_links":[],"categories":["Asynchronous Event Loop","C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwlgq2%2Fuv-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwlgq2%2Fuv-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwlgq2%2Fuv-cpp/lists"}