{"id":25215693,"url":"https://github.com/itsfuad/xebec-server","last_synced_at":"2025-09-15T02:32:58.792Z","repository":{"id":267526291,"uuid":"846178225","full_name":"itsfuad/Xebec-Server","owner":"itsfuad","description":"HTTP server implementation written in C++ using the Winsock API for Windows.","archived":false,"fork":false,"pushed_at":"2025-03-13T07:55:56.000Z","size":282,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-04T17:10:13.657Z","etag":null,"topics":["cpp","cpp-http-server","http-server"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itsfuad.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":"2024-08-22T17:20:06.000Z","updated_at":"2025-03-25T09:43:06.000Z","dependencies_parsed_at":"2025-06-04T10:50:44.309Z","dependency_job_id":"b674e58e-9b98-4e0b-af5f-bb9514b4e315","html_url":"https://github.com/itsfuad/Xebec-Server","commit_stats":null,"previous_names":["itsfuad/xebec-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/itsfuad/Xebec-Server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsfuad%2FXebec-Server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsfuad%2FXebec-Server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsfuad%2FXebec-Server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsfuad%2FXebec-Server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itsfuad","download_url":"https://codeload.github.com/itsfuad/Xebec-Server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsfuad%2FXebec-Server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275194849,"owners_count":25421651,"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","status":"online","status_checked_at":"2025-09-15T02:00:09.272Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cpp","cpp-http-server","http-server"],"created_at":"2025-02-10T18:15:22.746Z","updated_at":"2025-09-15T02:32:58.779Z","avatar_url":"https://github.com/itsfuad.png","language":"C++","readme":"# Xebec-Server\n\nA modern, header-only C++ HTTP server library with support for WebSockets, templates, and plugins.\n\n## Features\n\n- Header-only library\n- Modern C++ design\n- Cross-platform support (Windows and Unix-like systems)\n- HTTP/1.1 compliant\n- WebSocket support\n- Template engine\n- Plugin system\n- Middleware support\n- Static file serving\n- JSON responses\n- Error handling\n- Route parameters\n- Query string parsing\n\n## Requirements\n\n- C++17 or later\n- CMake 3.10 or later\n- Compiler with C++17 support\n\n## Installation\n\n### Using CMake\n\n```cmake\n# Add to your CMakeLists.txt\nadd_subdirectory(xebec-server)\ntarget_link_libraries(your_target PRIVATE xebec::xebec)\n```\n\n### Manual Installation\n\n1. Clone the repository\n2. Copy the `include/xebec` directory to your project's include path\n3. Include the main header in your source files:\n```cpp\n#include \u003cxebec/xebec.hpp\u003e\n```\n\n## Quick Start\n\n```cpp\n#include \u003cxebec/xebec.hpp\u003e\n#include \u003ciostream\u003e\n\nint main() {\n    xebec::ServerConfig config;\n    config.port = 8080;\n    xebec::http_server server(config);\n    \n    // Set public directory for static files\n    server.publicDir(\"public\");\n    \n    // Add middleware for logging\n    server.use([](xebec::Request\u0026 req, xebec::Response\u0026 res, xebec::MiddlewareContext::NextFunction next) {\n        std::cout \u003c\u003c \"Request received\" \u003c\u003c std::endl;\n        next();\n    });\n    \n    // Add routes\n    server.get(\"/\", [](xebec::Request\u0026 req, xebec::Response\u0026 res) {\n        res.html(\"index.html\");\n    });\n    \n    server.get(\"/api/hello\", [](xebec::Request\u0026 req, xebec::Response\u0026 res) {\n        res.json(\"{\\\"message\\\": \\\"Hello, World!\\\"}\");\n    });\n    \n    // Start server\n    server.start();\n    return 0;\n}\n```\n\n## Features in Detail\n\n### Route Parameters\n\n```cpp\nserver.get(\"/users/:id\", [](xebec::Request\u0026 req, xebec::Response\u0026 res) {\n    res \u003c\u003c \"User ID: \" \u003c\u003c req.params.at(\"id\");\n});\n```\n\n### WebSocket Support\n\n```cpp\nserver.ws(\"/ws\", [](xebec::WebSocketFrame\u0026 frame, std::function\u003cvoid(const xebec::WebSocketFrame\u0026)\u003e send) {\n    // Echo back the received message\n    xebec::WebSocketFrame response;\n    response.fin = true;\n    response.opcode = 0x1; // Text frame\n    response.payload = frame.payload;\n    send(response);\n});\n```\n\n### Template Engine\n\n```cpp\nserver.set_template_dir(\"templates\");\nserver.get(\"/\", [](xebec::Request\u0026 req, xebec::Response\u0026 res) {\n    std::map\u003cstd::string, std::string\u003e vars = {\n        {\"title\", \"Welcome\"},\n        {\"content\", \"Hello, World!\"}\n    };\n    server.render(res, \"index.html\", vars);\n});\n```\n\n### Error Handling\n\n```cpp\nserver.use_error_handler([](const xebec::HttpError\u0026 e, xebec::Request\u0026 req, xebec::Response\u0026 res) {\n    res.status_code(e.status_code())\n       .json(\"{\\\"error\\\": \\\"\" + std::string(e.what()) + \"\\\"}\");\n});\n```\n\n## Building from Source\n\n```bash\ngit clone https://github.com/yourusername/xebec-server.git\ncd xebec-server\nmkdir build \u0026\u0026 cd build\ncmake ..\ncmake --build .\n```\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsfuad%2Fxebec-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitsfuad%2Fxebec-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsfuad%2Fxebec-server/lists"}