{"id":15026947,"url":"https://github.com/corvusoft/restbed","last_synced_at":"2025-05-14T07:08:33.282Z","repository":{"id":33980788,"uuid":"37728539","full_name":"Corvusoft/restbed","owner":"Corvusoft","description":"Corvusoft's Restbed framework brings asynchronous RESTful functionality to C++14 applications.","archived":false,"fork":false,"pushed_at":"2024-09-06T09:30:05.000Z","size":4102,"stargazers_count":1951,"open_issues_count":85,"forks_count":377,"subscribers_count":101,"default_branch":"master","last_synced_at":"2025-04-11T02:51:29.942Z","etag":null,"topics":["async-programming","asynchronous","comet","cpp","http","http-server","http2","push","restful","restful-api","restful-webservices","server-sent-events","ssl-support","tls-support","websocket","websocket-api","websocket-library"],"latest_commit_sha":null,"homepage":"http://www.corvusoft.co.uk","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"google/brotli","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Corvusoft.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":"2015-06-19T15:07:39.000Z","updated_at":"2025-04-07T03:55:10.000Z","dependencies_parsed_at":"2022-07-13T17:10:42.921Z","dependency_job_id":"795c415e-037b-4d22-b837-e0afec9c86ba","html_url":"https://github.com/Corvusoft/restbed","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Corvusoft%2Frestbed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Corvusoft%2Frestbed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Corvusoft%2Frestbed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Corvusoft%2Frestbed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Corvusoft","download_url":"https://codeload.github.com/Corvusoft/restbed/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254092775,"owners_count":22013290,"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":["async-programming","asynchronous","comet","cpp","http","http-server","http2","push","restful","restful-api","restful-webservices","server-sent-events","ssl-support","tls-support","websocket","websocket-api","websocket-library"],"created_at":"2024-09-24T20:05:27.404Z","updated_at":"2025-05-14T07:08:33.258Z","avatar_url":"https://github.com/Corvusoft.png","language":"C++","readme":"Restbed [![Build Status](https://ci.appveyor.com/api/projects/status/naho4wmrxd47vko8/branch/master?svg=true)](https://ci.appveyor.com/project/Corvusoft/restbed/branch/master)\n=============================================================================================================================\n\n---\n\nRestbed is a comprehensive and consistent programming model for building applications that require seamless and secure communication over HTTP, with the ability to model a range of business processes, designed to target mobile, tablet, desktop and embedded production environments.\n\n\u003e It's akin to embedding NGINX into your companies own product line. -- Solutions Architect, Bellrock Technology\n\nFeatures\n--------\n\n| Feature                                                                                                                                                                                                       | Description                                                                                                                                                                                                                                                                                          |\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [WebSockets](https://github.com/Corvusoft/restbed/blob/master/documentation/example/WEB_SOCKET.md)                                                                                                          | Full-duplex communication channels over a single TCP connection.                                                                                                                                                                                                                                     |\n| [Server-Sent Events](https://github.com/Corvusoft/restbed/blob/master/documentation/example/SERVER_SIDE_EVENTS.md)                                                                                          | Server-Sent Events enables efficient server-to-client streaming of text-based event data—e.g., real-time notifications or updates generated on the server.                                                                                                                                           |\n| [Comet](https://github.com/Corvusoft/restbed/blob/master/documentation/example/HTTP_PERSISTENT_CONNECTION.md)                                                                                                    | Long polling model to allow long-held HTTP requests for pushing data from the server to client.                                                                                                                                                                                                      |\n| [SSL/TLS](https://github.com/Corvusoft/restbed/blob/master/documentation/example/HTTPS_SERVICE.md)                                                                                                          | Secure over the wire communication allowing you to transmit private data online.                                                                                                                                                                                                                     |\n| [Session Management](https://github.com/Corvusoft/restbed/blob/master/documentation/example/SESSION_MANAGER.md)                                                                                             | Create custom HTTP session persistence and management logic.                                                                                                                                                                                                                                         |\n| [HTTP Pipelining](https://github.com/Corvusoft/restbed/blob/master/documentation/example/HTTP_PIPELINING.md)                                                                                                | A technique allowing multiple HTTP requests to be sent on a single TCP connection without waiting for the corresponding responses.                                                                                                                                                                   |\n| [Path Parameters](https://github.com/Corvusoft/restbed/blob/master/documentation/example/PATH_PARAMETERS.md)                                                                                                | Annotate URIs with custom path parameters such as resource keys, revisions, etc...                                                                                                                                                                                                                   |\n| Query Parameters                                                                                                                                                                                              | Automated query parameter parsing.                                                                                                                                                                                                                                                                   |\n| [Header Filters](https://github.com/Corvusoft/restbed/blob/master/documentation/example/RESOURCE_FILTERING.md)                                                                                              | Filter incoming HTTP requests by headers.                                                                                                                                                                                                                                                            |\n| [Logging](https://github.com/Corvusoft/restbed/blob/master/documentation/example/LOGGING.md)                                                                                                                | Customise how and where log entries are created.                                                                                                                                                                                                                                                     |\n| [Multi-Path Resources](https://github.com/Corvusoft/restbed/blob/master/documentation/example/MULTIPATH_RESOURCES.md)                                                                            | Give a resource multiple paths for improved readability.                                                                                                                                                                                                                                             |\n| [Customisable Methods](https://github.com/Corvusoft/restbed/blob/master/documentation/example/CUSTOM_HTTP_METHOD.md)                                                                                            | Add your own custom HTTP methods.                                                                                                                                                                                                                                                                    |\n| [Compression](https://github.com/Corvusoft/restbed/blob/master/documentation/example/COMPRESSION.md)                                                                                                        | Adaptability to address any form of compression GZip, Deflate, etc...                                                                                                                                                                                                                                |\n| Encoding                                                                                                                                                                                                      | Adaptability to address any form of encoding UTF-32, ASCII, etc...                                                                                                                                                                                                                                   |\n| [Rules Engine](https://github.com/Corvusoft/restbed/blob/master/documentation/example/RULES_ENGINE.md)                                                                                                      | Reduce complexity by processing incoming requests with readable units of code.                                                                                                                                                                                                                       |\n| [HTTP](https://github.com/Corvusoft/restbed/blob/master/documentation/example/HTTP_CLIENT.md)/[HTTPS](https://github.com/Corvusoft/restbed/blob/master/example/https_client/source/verify_none.cpp) | Built in client capabilities with optional SSL peer certificate verification. Deprecated                                                                                                                                                                                                                       |\n| IPv4/IPv6                                                                                                                                                                                                     | Internet Protocol Version 4/6 Network Support.                                                                                                                                                                                                                                                       |\n| Architecture                                                                                                                                                                                                  | Asynchronous [single](https://github.com/Corvusoft/restbed/blob/master/example/publishing_resources/source/example.cpp) or [multi-threaded](https://github.com/Corvusoft/restbed/blob/master/documentation/example/MULTITHREADED_SERVICE.md) architecture, capable of addressing the C10K problem. |\n| Converters                                                                                                                                                                                                    | Built-in Path, Query, and Header conversions for primary data-types.                                                                                                                                                                                                                                 |\n| [Authentication](https://github.com/Corvusoft/restbed/blob/master/documentation/example/DIGEST_AUTHENTICATION.md)                                                                                                  | Separate Service and/or Resource level authentication.                                                                                                                                                                                                                                               |\n| [Error Handling](https://github.com/Corvusoft/restbed/blob/master/documentation/example/ERROR_HANDLING.md)                                                                                                  | Separate Service and/or Resource level error handling.                                                                                                                                                                                                                                               |\n| [Address Binding](https://github.com/Corvusoft/restbed/blob/master/documentation/example/ADDRESS_BINDING.md)                                                                                           | Bind HTTP and/or HTTPS services to separate IP addresses.                                                                                                                                                                                                                                            |\n| [Signal Handling](https://github.com/Corvusoft/restbed/blob/master/documentation/example/SIGNAL_HANDLING.md)                                                                                                | Capture OS generated process signals.                                                                                                                                                                                                                                                                |\n| [Documentation](https://github.com/Corvusoft/restbed/tree/master/documentation)                                                                                                                               | High-quality documentation covering the architecture and API.                                                                                                                                                                                                                                        |\n| Compliance                                                                                                                                                                                                    | Flexibility to address HTTP 1.0/1.1+ compliance.                                                                                                                                                                                                                                                     |\n| Mature                                                                                                                                                                                                        | Secure, Stable, and extensively tested since 2013.                                                                                                                                                                                                                                                   |\n| Community                                                                                                                                                                                                     | Active, vibrant and energetic open source community.                                                                                                                                                                                                                                                 |\n| Support                                                                                                                                                                                                       | Commercial support is available from [Corvusoft](http://www.corvusoft.co.uk).                                                                                                                                                                                                                        |\n\nExample\n-------\n\n```C++\n#include \u003cmemory\u003e\n#include \u003ccstdlib\u003e\n#include \u003crestbed\u003e\n\nusing namespace std;\nusing namespace restbed;\n\nvoid post_method_handler( const shared_ptr\u003c Session \u003e session )\n{\n    const auto request = session-\u003eget_request( );\n\n    int content_length = request-\u003eget_header( \"Content-Length\", 0 );\n\n    session-\u003efetch( content_length, [ ]( const shared_ptr\u003c Session \u003e session, const Bytes \u0026 body )\n    {\n        fprintf( stdout, \"%.*s\\n\", ( int ) body.size( ), body.data( ) );\n        session-\u003eclose( OK, \"Hello, World!\", { { \"Content-Length\", \"13\" } } );\n    } );\n}\n\nint main( const int, const char** )\n{\n    auto resource = make_shared\u003c Resource \u003e( );\n    resource-\u003eset_path( \"/resource\" );\n    resource-\u003eset_method_handler( \"POST\", post_method_handler );\n\n    auto settings = make_shared\u003c Settings \u003e( );\n    settings-\u003eset_port( 1984 );\n    settings-\u003eset_default_header( \"Connection\", \"close\" );\n\n    Service service;\n    service.publish( resource );\n    service.start( settings );\n\n    return EXIT_SUCCESS;\n}\n```\n\nMore in-depth examples can be found [here](https://github.com/Corvusoft/restbed/tree/master/documentation/example). To see Restbed used in anger, please visit Corvusoft's [RestQ](https://github.com/corvusoft/restq) project.\n\nLicense\n-------\n\n\u0026copy; 2013-2020 Corvusoft Limited, United Kingdom. All rights reserved.\n\nThe Restbed framework is dual licensed; See [LICENSE](LICENSE) for full details.\n\nSupport\n-------\n\nPlease contact sales@corvusoft.co.uk, for support and licensing options including bespoke software development, testing, design consultation, training, mentoring and code review.\n\nPlease submit all enhancements, proposals, and defects via the [issue](http://github.com/corvusoft/restbed/issues) tracker; Alternatively ask a question on [StackOverflow](http://stackoverflow.com/questions/ask) tagged [#restbed](http://stackoverflow.com/questions/tagged/restbed).\n\nBuild\n-----\n\n```bash\ngit clone --recursive https://github.com/corvusoft/restbed.git\nmkdir restbed/build\ncd restbed/build\ncmake [-DBUILD_SSL=NO] [-DBUILD_TESTS=NO] ..\nmake install\nmake test\n```\n\nYou will now find all required components installed in the distribution sub-folder.\n\nBuild Options\n-------------\n\n| Option               | Description                                | Default  |\n| :------------------- | :----------------------------------------- | :------: |\n| BUILD_SSL            | Enable SSL/TLS support.                    | Enabled  |\n| BUILD_IPC            | Enable Unix domain sockets.                | Disabled |\n| BUILD_TESTS          | Build project test suites.                 | Enabled  |\n| BUILD_DEVEL_PACKAGE  | Install headers into CMAKE_INSTALL_PREFIX. | Enabled  |\n| BUILD_SHARED_LIBRARY | Produce a shared build of restbed.         | Enabled  |\n| BUILD_STATIC_LIBRARY | Produce a static build of restbed.         | Enabled  |\n\nWindows Build Instructions\n--------------------------\n\nPrerequisites: Visual Studio 2022, CMake, GIT, Perl.\n\nUsing the x64 Native Tools Command Prompt begin by, if required, building OpenSSL.\n```cmd\ngit clone --recursive https://github.com/corvusoft/restbed.git\n\ncd restbed\\dependency\\openssl\nperl Configure [no-]shared\nnmake\nnmake test\n```\n\nIf you selected to use the default OpenSSL build (shared), you'll need to include the installation path in your environment.\n\n```cmd\nset PATH=restbed\\dependency\\openssl;%PATH%\n```\n\nIf you selected to use the static OpenSSL build (no-shared), you'll need to include additional dependencies when linking your application code; See [OpenSSL project](https://github.com/openssl/openssl/pull/1062/files) for futher details.\n\n```cmd\ntarget_link_libraries( my_microservice restbed-static.lib ws2_32.lib advapi32.lib crypt32.lib gdi32.lib user32.lib )\n```\n\nNow proceed with the following Restbed build instructions.\n\n```cmd\nmkdir restbed\\build\ncd restbed\\build\ncmake -G \"Visual Studio 17 2022\" [-DBUILD_SSL=NO] [-DBUILD_TESTS=NO] ..\ncmake --build . --target ALL_BUILD --config Release\nctest\n```\n\nFor Microsoft Visual Studio 14 2015 instructions, and further details, please see feature [#17](https://github.com/Corvusoft/restbed/issues/17).\n\nBuilding Restbed - Using vcpkg\n------------------------------\n\nYou can download and install restbed using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager:\n\n``` shell\ngit clone https://github.com/Microsoft/vcpkg.git\ncd vcpkg\n./bootstrap-vcpkg.sh\n./vcpkg integrate install\n./vcpkg install restbed\n```\n\nThe restbed port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.\n\n\nDocumentation\n-------------\n\nThis codebase is intended to be as self documenting as possible. We have supplied many [examples](https://github.com/Corvusoft/restbed/tree/master/documentation/example) and [test suites](https://github.com/corvusoft/restbed/tree/master/test) to help aid developers.\n\nYou can locate the latest design and API documentation [here](https://github.com/Corvusoft/restbed/tree/master/documentation).\n\nMinimum Requirements\n--------------------\n\n| Resource | Requirement                                     |\n|:--------:|:-----------------------------------------------:|\n| Compiler |            C++14 compliant or above             |\n|    OS    | BSD, Linux, Mac OSX, Windows, Raspbian          |\n\nRoad Map\n--------\n\n| Milestone                                                                           | Feature                                 | Status      |\n|:-----------------------------------------------------------------------------------:|:---------------------------------------:|:-----------:|\n|                                         0.0                                         |        Asynchronous HTTP Service        |  complete   |\n|                                         1.0                                         |           HTTP 1.0 Compliance           |  complete   |\n|                                         2.0                                         |           HTTP 1.1 Compliance           |  complete   |\n|                                         2.5                                         |           Secure Socket Layer           |  complete   |\n|                                         2.5                                         | Simultaneous Network Ports (HTTP/HTTPS) |  complete   |\n|                                         3.0                                         |              Rules Engine               |  complete   |\n| [3.5](https://github.com/Corvusoft/restbed/issues?utf8=%E2%9C%93\u0026q=milestone%3A3.5) |   Schedule Tasks on Service run-loop    |  complete   |\n| [3.5](https://github.com/Corvusoft/restbed/issues?utf8=%E2%9C%93\u0026q=milestone%3A3.5) |    Multi-Threaded service capability    |  complete   |\n| [3.5](https://github.com/Corvusoft/restbed/issues?utf8=%E2%9C%93\u0026q=milestone%3A3.5) |    Bind Service to specific Address     |  complete   |\n| [3.5](https://github.com/Corvusoft/restbed/issues?utf8=%E2%9C%93\u0026q=milestone%3A3.5) |           Session Management            |  complete   |\n|             [4.0](https://github.com/Corvusoft/restbed/milestones/4.0)              |               HTTP Client               |  complete   |\n|             [4.0](https://github.com/Corvusoft/restbed/milestones/4.0)              |             Signal Handling             |  complete   |\n|             [4.5](https://github.com/Corvusoft/restbed/milestones/4.5)              |            API Documentation            |  complete   |\n|             [4.5](https://github.com/Corvusoft/restbed/milestones/4.5)              |               Web Sockets               |  complete   |\n|             [5.0](https://github.com/Corvusoft/restbed/milestones/5.0)              |      Client-side SSL certificates       | development |\n|             [5.0](https://github.com/Corvusoft/restbed/milestones/5.0)              |            Resource Caching             | development |\n|             [5.0](https://github.com/Corvusoft/restbed/milestones/5.0)              |          Runtime Modifications          | development |\n|             [5.0](https://github.com/Corvusoft/restbed/milestones/5.0)              |            HTTP 2 compliance            | development |\n|             [5.0](https://github.com/Corvusoft/restbed/milestones/5.0)              |         Refactor, Reduce, Reuse         |   active    |\n\nContact\n-------\n\n| Method                                      | Description                                 |\n|:--------------------------------------------|:--------------------------------------------|\n| [Twitter](http://www.twitter.com/corvusoft) | Tweet us your questions \u0026 feature requests. |\n| support@corvusoft.co.uk                     | Support related queries.                    |\n| sales@corvusoft.co.uk                       | Sale related queries.                       |\n","funding_links":[],"categories":["Networking","内存分配"],"sub_categories":["网络"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorvusoft%2Frestbed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcorvusoft%2Frestbed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorvusoft%2Frestbed/lists"}