C++ http 流媒体等 开源项目记录

来源:互联网 发布:四川厚名网络 编辑:程序博客网 时间:2024/06/05 03:51

1、 http client 

 libcurl (C语言写的)、QT 的QNetworkAccessManager、CPP REST SDK是微软开源的基于PPL的异步http client

2、流媒体服务器

  SRS(simple rtmp server) 地址 https://github.com/winlinvip/srs

  EasyDarwin、Live555

3、RPC框架

   阿里的Dubbo 地址  https://github.com/alibaba/dubbo

  百度的sofa-pbrpc    地址:https://github.com/baidu/sofa-pbrpc

 4、sqlite 客户端

    smartdb 地址 https://github.com/chxuan/smartdb

   easysqlite


5、http server 

 https://github.com/Corvusoft/restbed

Restbed 框架为 C++11 构建的程序带来了 restful 功能,它基于 boost.asio 创建。

Restbed 可用于需要通过 HTTP 无缝和安全通信构建应用程序的全面和一致的编程模型,能够对一系列业务流程进行建模,旨在针对移动,平板电脑,桌面和嵌入式生产环境。

它类似于将 NGINX 嵌入到您公司自己的产品线中。


git clone --recursive https://github.com/corvusoft/restbed.git
mkdir restbed/build
cd restbed/build
cmake -DBUILD_TESTS=YES -DBUILD_EXAMPLES=YES -DBUILD_SSL=NO] [-DBUILD_SHARED=YES -DCMAKE_INSTALL_PREFIX=/output-directory  ..
make -j 2  install  //CPU_CORES+1  cpu核数加一

编译完后 会在/output-directory 生成 所有文件

编译他给的例子

Example demo.cpp

#include <cstdlib>#include <restbed> #include <memory>using namespace std;using namespace restbed;void post_method_handler( const shared_ptr< Session > session ){    const auto request = session->get_request( );    int content_length = request->get_header( "Content-Length", 0 );    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;}


g++ -std=c++11 demo.cpp -o demo -lrestbed -I/output-directory/include -L/output-directory/library

 测试

curl -d "param1=value1&param2=value2" "http://192.168.6.185:1984/resource"

curl -d 表示 post 请求

6、http server  windows端

  https://github.com/ellzey/libevhtp/

7、 http server  ehttp 


https://github.com/hongliuliao/ehttp



安卓直播客户端 ,来疯

https://github.com/LaiFeng-Android/SopCastComponent


介绍:http://www.jianshu.com/p/7ebbcc0c5df7

0 0
原创粉丝点击