{"id":27734299,"url":"https://github.com/chxuan/easyhttp","last_synced_at":"2026-03-08T17:38:17.822Z","repository":{"id":77439709,"uuid":"116450583","full_name":"chxuan/easyhttp","owner":"chxuan","description":"C++ http server","archived":false,"fork":false,"pushed_at":"2018-06-28T10:52:01.000Z","size":42,"stargazers_count":22,"open_issues_count":0,"forks_count":53,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-28T13:04:07.202Z","etag":null,"topics":["asio","boost","http-server"],"latest_commit_sha":null,"homepage":null,"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/chxuan.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}},"created_at":"2018-01-06T03:38:24.000Z","updated_at":"2024-09-26T12:26:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"3c57b8ad-d793-4d79-b7b1-5be730dabe0d","html_url":"https://github.com/chxuan/easyhttp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chxuan%2Feasyhttp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chxuan%2Feasyhttp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chxuan%2Feasyhttp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chxuan%2Feasyhttp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chxuan","download_url":"https://codeload.github.com/chxuan/easyhttp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251319611,"owners_count":21570426,"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":["asio","boost","http-server"],"created_at":"2025-04-28T13:03:59.125Z","updated_at":"2026-03-08T17:38:17.782Z","avatar_url":"https://github.com/chxuan.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A modern C++ http framework\n\n\u003e easyhttp是采用C++开发的，使用方便的http server库。\n\n![License][1] \n\n## Tutorial\n\n* **Simple server**\n\n    ```cpp\n    #include \"easyhttp/easyhttp.h\"\n    \n    using namespace std::placeholders;\n    using namespace easyhttp;\n\n    void add(const std::shared_ptr\u003crequest\u003e\u0026 req, const std::shared_ptr\u003cresponse\u003e\u0026 res)\n    {\n        int a = std::atoi(req-\u003eget_param_value(\"a\").c_str());\n        int b = std::atoi(req-\u003eget_param_value(\"b\").c_str());\n        res-\u003eset_response(std::to_string(a + b));\n    }\n\n    int main()\n    {\n        // 1.创建http server服务对象\n        // 服务端将采用1个io线程和2个work线程服务\n        auto server = std::make_shared\u003chttp_server\u003e(\"0.0.0.0:6666\", 1, 2);\n\n        // 2.设置路由\n        server-\u003eroute(\"/add\", std::bind(add, _1, _2));\n    \n        // 3.启动事件循环（非阻塞）\n        server-\u003erun();\n\n        std::cin.get();\n        return 0;\n    }\n    ```\n\n    在浏览器中输入该网址即可访问。\n    ```\n    http://localhost:6666/add?a=1\u0026b=1\n    ```\n\n## 开发平台\n\n* Ubuntu17.10 gcc7.2.0\n\n## 依赖性\n\n* boost\n* c++11\n\n## DONE\n\n* HTTP1.0。\n\n## TODO\n\n* HTTP1.1的支持。\n\n## License\nThis software is licensed under the [MIT license][2]. © 2018 chxuan\n\n\n  [1]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat-square\n  [2]: https://github.com/chxuan/easyhttp/blob/master/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchxuan%2Feasyhttp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchxuan%2Feasyhttp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchxuan%2Feasyhttp/lists"}