Giter Site home page Giter Site logo

beast-boys's Introduction

BeastBoys

Only tested on macos for now.

BeastBoys is a is a collection of helpers classes built over boost::beast, designed to make it easier to open WebSocket streams and REST requests. This library is intended to simplify the implementation of real-time communication and API interactions in modern C++ projects.

Required packages

You will need to install boost and openssl.

Below some instructions how to do it:

MACOS -> install it using brew:

brew install boost
brew install [email protected]

Features

Simple and intuitive API

WebSocket client implementation (using SSL or not)

REST client implementation

Lightweight

Example Usage

Here's a basic example to open a TCP socket:


#include <iostream>
#include <beastboys>


int main(){

    std::shared_ptr<bb::Streamer> streamer(new bb::Streamer());

    auto stream = streamer->openStream("stream.binance.com",
                                        "9443",
                                        "/ws/btcusdt@kline_1s",
                                        true, //uses SSL
    [](bool success, const std::string& data, auto stream){
        if(!success) {
            std::cout << "Stream1 closed with msg: " << data << "\n\n";
            return;
        }

        //Work with your streamed data here
        std::cout << data << "\n\n";

    });
    
    // Get 10 seconds of market data
    std::this_thread::sleep_for(std::chrono::seconds(10));

    return 0;
}

Authors

beast-boys's People

Contributors

alissonads avatar tatolevicz avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.