Restbed - C++11 异步RESTful框架

网友投稿 1596 2022-10-19

Restbed - C++11 异步RESTful框架

Restbed - C++11 异步RESTful框架

Restbed 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.

It's akin to embedding NGINX into your companies own product line. -- Solutions Architect, Bellrock Technology

Features

FeatureDescription
WebSocketsFull-duplex communication channels over a single TCP connection.
Server-Sent EventsServer-Sent Events enables efficient server-to-client streaming of text-based event data—e.g., real-time notifications or updates generated on the server.
CometLong polling model to allow long-held HTTP requests for pushing data from the server to client.
SSL/TLSSecure over the wire communication allowing you to transmit private data online.
Session ManagementCreate custom HTTP session persistence and management logic.
Path ParametersAnnotate URIs with custom path parameters such as resource keys, revisions, etc...
Query ParametersAutomated query parameter parsing.
Header FiltersFilter incoming HTTP requests by headers.
LoggingCustomise how and where log entries are created.
Multi-Path ResourcesGive a resource multiple paths for improved readability.
Customisable MethodsAdd your own custom HTTP methods.
CompressionAdaptability to address any form of compression GZip, Deflate, etc...
EncodingAdaptability to address any form of encoding UTF-32, ASCII, etc...
Rules EngineReduce complexity by processing incoming requests with readable units of code.
HTTP/HTTPSBuilt in client capabilities with optional SSL peer certificate verification.
IPv4/IPv6Internet Protocol Version 4/6 Network Support.
ArchitectureAsynchronous single or multi-threaded architecture, capable of addressing the C10K problem.
ConvertersBuilt-in Path, Query, and Header conversions for primary data-types.
AuthenticationSeparate Service and/or Resource level authentication.
Error HandlingSeparate Service and/or Resource level error handling.
Address BindingBind HTTP and/or HTTPS services to separate IP addresses.
Signal HandlingCapture OS generated process signals.
ComplianceFlexibility to address HTTP 1.0/1.1+ compliance.
MatureSecure, Stable, and extensively tested since 2013.
CommunityActive, vibrant and energetic open source community.
SupportCommercial support is available from Corvusoft.

Example

#include #include #include using namespace std;using namespace restbed;void post_method_handler( const shared_ptr< Session > session ){ const auto request = session->get_request( ); int content_length = 0; request->get_header( "Content-Length", content_length ); session->fetch( content_length, [ ]( const shared_ptr< Session > session, const Bytes & body ) { fprintf( stdout, "%.*s\n", ( int ) body.size( ), body.data( ) ); session->close( OK, "Hello, World!", { { "Content-Length", "13" } } ); } );}int main( const int, const char** ){ auto resource = make_shared< Resource >( ); resource->set_path( "/resource" ); resource->set_method_handler( "POST", post_method_handler ); auto settings = make_shared< Settings >( ); settings->set_port( 1984 ); settings->set_default_header( "Connection", "close" ); Service service; service.publish( resource ); service.start( settings ); return EXIT_SUCCESS;}

More in-depth examples can be found here. To see Restbed used in anger, please visit Corvusoft's RestQ project.

License

© 2013-2016 Corvusoft Limited, United Kingdom. All rights reserved.

The Restbed framework is dual licensed; See LICENSE for full details.

Support

Please contact sales@corvusoft.co.uk, for support and licensing options including bespoke software development, testing, design consultation, training, mentoring and code review.

Build

git clone --recursive https://github.com/corvusoft/restbed.gitmkdir restbed/buildcd restbed/buildcmake [-DBUILD_TESTS=YES] [-DBUILD_EXAMPLES=YES] [-DBUILD_SSL=NO] [-DBUILD_SHARED=YES] [-DCMAKE_INSTALL_PREFIX=/output-directory] ..make [-j CPU_CORES+1] installmake test

You will now find all required components installed in the distribution folder.

Please submit all enhancements, proposals, and defects via the issue tracker; Alternatively ask a question on StackOverflow tagged #restbed.

For Microsoft Visual Studio instructions please see feature #17.

Documentation

This codebase is intended to be as self documenting as possible. We have supplied many examples and test suites to help aid developers.

We are currently working on textual API documentation, however it's subject to erratic and frequent alteration; you've been warned.

Minimum Requirements

ResourceRequirement
CompilerC++11 compliant or above
OSBSD, Linux, Mac OSX, Solaris, Windows, Raspbian

Road Map

MilestoneFeatureStatus
0.0Asynchronous HTTP Servicecomplete
1.0HTTP 1.0 Compliancecomplete
2.0HTTP 1.1 Compliancecomplete
2.5Secure Socket Layercomplete
2.5Simultaneous Network Ports (HTTP/HTTPS)complete
3.0Rules Enginecomplete
3.5Schedule Tasks on Service run-loopcomplete
3.5Multi-Threaded service capabilitycomplete
3.5Bind Service to specific Addresscomplete
3.5Session Managementcomplete
4.0HTTP Clientcomplete
4.0Signal Handlingcomplete
4.5API Documentationdevelopment
4.5Web Socketscomplete
5.0Client-side SSL certificatespending
5.0Resource Cachingpending
5.0Runtime Modificationspending
5.0HTTP 2 compliancepending
5.0Refactor, Reduce, Reusepending

Contact

MethodDescription
TwitterTweet us your questions & feature requests.
support@corvusoft.co.ukSupport related queries.
sales@corvusoft.co.ukSale related queries.

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:关于SpingMVC的&lt;context:component
下一篇:Ripple Fullstack - 现代全栈框架
相关文章

 发表评论

暂时没有评论,来抢沙发吧~