{"id":16952936,"url":"https://github.com/benpope/pusher-cpp","last_synced_at":"2025-04-11T21:21:52.410Z","repository":{"id":79479564,"uuid":"79855964","full_name":"BenPope/pusher-cpp","owner":"BenPope","description":"Pusher++ is a header-only cross-platform C++ library for connecting to Pusher","archived":false,"fork":false,"pushed_at":"2018-01-25T15:21:09.000Z","size":27,"stargazers_count":18,"open_issues_count":2,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-11T21:21:43.842Z","etag":null,"topics":["asio","beast","boost","cmake","cpp","openssl","pusher"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BenPope.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE_1_0.txt","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":"2017-01-23T22:41:48.000Z","updated_at":"2024-05-03T14:27:38.000Z","dependencies_parsed_at":"2023-04-01T12:33:00.896Z","dependency_job_id":null,"html_url":"https://github.com/BenPope/pusher-cpp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenPope%2Fpusher-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenPope%2Fpusher-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenPope%2Fpusher-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenPope%2Fpusher-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BenPope","download_url":"https://codeload.github.com/BenPope/pusher-cpp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248480467,"owners_count":21110946,"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":["asio","beast","boost","cmake","cpp","openssl","pusher"],"created_at":"2024-10-13T22:05:16.234Z","updated_at":"2025-04-11T21:21:52.387Z","avatar_url":"https://github.com/BenPope.png","language":"C++","readme":"# Pusher client and server built on Boost.Asio\n\n## Contents\n\n- [Introduction](#introduction)\n- [Features](#features)\n- [Usage](#usage)\n- [Requirements](#requirements)\n- [Status](#status)\n- [Licence](#licence)\n- [Contact](#contact)\n\n## Introduction\n\nPusher++ is a header-only cross-platform C++ library for connecting to [Pusher](https://pusher.com). It's built on top of Boost.Asio via Boost.Beast for HTTP and Websocket support.\n\n## Features\n\n * **Performance.** Supports both synchronous and asynchronous APIs.\n * **SSL support.** Connect securely to endpoints at Pusher and bypass problematic proxies.\n * **Symmetric API** Client and Server share the same API.\n\n## Usage\n\nThese examples are complete, but you will have to set your application specific credentials. The [examples](pusher++/examples) directory contains examples that parse the command line.\n\nExample Server:\n\n```C++\n#include \u003cpusher++/server.hpp\u003e\n#include \u003ciostream\u003e\n\nint main()\n{\n    std::string const app_id = \"Your App ID\";\n    std::string const secret = \"Your Secret\";\n    std::string const key = \"Your Key\";\n    \n    boost::asio::io_service ios;\n    pusher::server\u003cboost::asio::ip::tcp::socket\u003e server{ios, app_id, key, secret};\n    server.connect();\n\n    std::string input;\n    while(input != \"bye\" \u0026\u0026 std::cout \u003c\u003c \"\\nMessage: \" \u0026\u0026 std::getline(std::cin, input))\n    {\n        std::cout \u003c\u003c server.trigger(\"test_channel\", \"test_name\", input);\n    }\n    ios.run();\n}\n```\n\nExample Client:\n\n```C++\n#include \u003cpusher++/client.hpp\u003e\n#include \u003ciostream\u003e\n\nint main(int argc, char* argv[])\n{\n    std::string const key = \"Your Key\";\n    \n    boost::asio::io_service ios;\n    pusher::client\u003cboost::asio::ip::tcp::socket\u003e client{ios, key};\n    client.connect();\n    \n    client.bind_all([](pusher::event const\u0026 event)\n    {\n        std::cout \u003c\u003c event.data \u003c\u003c '\\n';\n    });\n\n    auto test_channel = client.channel(\"test_channel\");\n    test_channel.bind(\"test_name\", [\u0026client](pusher::event const\u0026 event)\n    {\n        if(event.data == \"bye\")\n            client.disconnect();\n    });\n    ios.run();\n}\n\n```\n\n## Requirements\n\n * C++14\n * [Beast](https://boostorg/beast) \u003e= 121\n * [Boost](http://www.boost.org) \u003e= 1.63\n * [RapidJSON](https://github.com/miloyip/rapidjson/) \u003e= v1.1.0\n * [Crypto++](https://github.com/weidai11/cryptopp) \u003e= 5.6.5 (server)\n * [OpenSSL](https://www.openssl.org/) = 1.0.2 (optional)\n\n## Build\n\nThis is a header only library, no building is required.\n\nHowever, a cmake build system is in place for tests and examples.  Currently, it is assumed that the environment is the environment is linux-ish and that Boost and OpenSSL headers are installed; other dependencies are managed by cmake.  Building on Windows should work, but is untested and will likely require some minor changes to find Boost and OpenSSL.\n\n```\nmkdir -p build \u0026\u0026 cd build \u0026\u0026 cmake .. \u0026\u0026 make -j\n```\n\n## Status\n\nCaveat emptor. This is very early work; it's incomplete and has not been used in anger. Everything is subject to change, but it may not be completed or even maintained.\n\nHowever, you are free to use it under the terms set out below.\n\n## Licence\n\nDistributed under the Boost Software License, Version 1.0. (See accompanying file [LICENSE_1_0.txt](LICENSE_1_0.txt) or copy at [http://www.boost.org/LICENSE_1_0.txt](http://www.boost.org/LICENSE_1_0.txt))\n\n## Contact\n\nPlease report issues or questions here:\nhttps://github.com/BenPope/pusher-cpp/issues\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenpope%2Fpusher-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenpope%2Fpusher-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenpope%2Fpusher-cpp/lists"}