{"id":19673098,"url":"https://github.com/wille-io/httq","last_synced_at":"2026-05-16T05:16:54.923Z","repository":{"id":136573275,"uuid":"277637832","full_name":"wille-io/httq","owner":"wille-io","description":"httq is an HTTP Server for Qt. Allows WebSocket connections. Based on NodeJS's http-parser.","archived":false,"fork":false,"pushed_at":"2024-04-22T08:51:10.000Z","size":86,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-10T03:51:41.269Z","etag":null,"topics":["http-parser","http-server","httpd","qt","websocket","websocket-server","websockets"],"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/wille-io.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}},"created_at":"2020-07-06T20:05:27.000Z","updated_at":"2024-04-22T08:51:13.000Z","dependencies_parsed_at":"2024-04-22T10:04:45.434Z","dependency_job_id":"0c63598e-fb13-45b5-b447-088781b383a5","html_url":"https://github.com/wille-io/httq","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/wille-io%2Fhttq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wille-io%2Fhttq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wille-io%2Fhttq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wille-io%2Fhttq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wille-io","download_url":"https://codeload.github.com/wille-io/httq/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240981558,"owners_count":19888346,"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":["http-parser","http-server","httpd","qt","websocket","websocket-server","websockets"],"created_at":"2024-11-11T17:14:04.287Z","updated_at":"2026-05-16T05:16:54.918Z","avatar_url":"https://github.com/wille-io.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# httq\n\nHTTP server library for Qt. Doesn't clog the memory like The Other HTTP Server™.\n\nBased on NodeJS's wonderful http-parser.\nCan download a message's body in chunks, instead of reading it all into memory that allows an easy DoS, like The Other HTTP Server™.\n\n## CMake Integration\n\n### Option A: Add as Subdirectory (recommended for local use)\n\n```\nadd_subdirectory(path/to/httq)\n\nadd_executable(my_app main.cpp)\ntarget_link_libraries(my_app\n  PRIVATE\n    httq\n    Qt${Qt_VERSION_MAJOR}::Core\n    Qt${Qt_VERSION_MAJOR}::Network\n    Qt${Qt_VERSION_MAJOR}::WebSockets\n)\ntarget_include_directories(my_app PRIVATE path/to/httq/include)\n```\n\n### Option B: Installed Library via find_package\n\n```\nfind_package(httq REQUIRED)\n\nadd_executable(my_app main.cpp)\ntarget_link_libraries(my_app PRIVATE httq::httq)\n```\n\n\u003e Note: This works after installing httq (exports targets and config files).\n\u003e For local projects, option A is currently the simplest approach.\n\n### Installing httq\n\n```\ncmake -S . -B build\ncmake --build build\nsudo cmake --install build\n```\n\n## C++ Examples\n\n### Minimal HTTP Handler\n\n```cpp\n#include \u003chttq/HandlerServer.h\u003e\n#include \u003chttq/AbstractHandler.h\u003e\n\nclass HelloHandler : public httq::AbstractHandler\n{\npublic:\n  void handle() override\n  {\n    answer(200, \"Hello from httq\");\n  }\n};\n\nint main(int argc, char **argv)\n{\n  QCoreApplication app(argc, argv);\n\n  httq::HandlerServer server;\n  server.addHandler(\"GET\", \"/hello\", []() { return new HelloHandler(); });\n  server.listen(8080);\n\n  return app.exec();\n}\n```\n\n### JSON Response\n\n```cpp\n#include \u003chttq/HandlerServer.h\u003e\n#include \u003chttq/AbstractHandler.h\u003e\n\nclass JsonHandler : public httq::AbstractHandler\n{\npublic:\n  void handle() override\n  {\n    QJsonObject obj { { \"ok\", true } };\n    answer(200, obj);\n  }\n};\n```\n\n### Body Handling with AbstractBodyHandler\n\n```cpp\n#include \u003chttq/AbstractBodyHandler.h\u003e\n\nclass EchoHandler : public httq::AbstractBodyHandler\n{\npublic:\n  using httq::AbstractBodyHandler::AbstractBodyHandler;\n\n  void bodyHandle() override\n  {\n    answer(200, body(), \"text/plain\");\n  }\n};\n```\n\n## Build and Run Tests (QTest)\n\n```\ncmake -S . -B build -DHTTQ_BUILD_TESTS=ON\ncmake --build build\nctest --test-dir build\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwille-io%2Fhttq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwille-io%2Fhttq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwille-io%2Fhttq/lists"}