0,0,0,1,0 travis-ci

C++11 implementation of Socket.IO client

Socket.IO C++ Client

Build Status

By virtue of being written in C++, this client works in several different platforms. The examples folder contains an iPhone, QT and Console example chat client! It depends on websocket++ and is inspired by

Clients with iPhone, QT, Console and web


  • 100% written in modern C++11
  • Compatible with 1.0+ protocol
  • Binary support
  • Automatic JSON encoding
  • Multiplex support
  • Similar API to the Socket.IO JS client
  • Cross platform

Installation alternatives


** Full overview of API can be seen here **

The APIs are similar to the JS client.

Connect to a server

sio::client h;

Emit an event

// emit event name only:

// emit text
h.socket()->emit("add user", username);

// emit binary
char buf[100];
h.socket()->emit("add user", std::make_shared<std::string>(buf,100));

// emit message object with lambda ack handler
h.socket()->emit("add user", string_message::create(username), [&](message::list const& msg) {

// emit multiple arguments
message::list li("sports");
socket->emit("categories", li);

Items in message::list will be expanded in server side event callback function as function arguments.

Bind an event

Bind with function pointer
void OnMessage(sio::event &)

h.socket()->on("new message", &OnMessage);
Bind with lambda
h.socket()->on("login", [&](sio::event& ev)
    //handle login message
    //post to UI thread if any UI updating.
Bind with member function
class MessageHandler
    void OnMessage(sio::event &);
MessageHandler mh;
h.socket()->on("new message",std::bind( &MessageHandler::OnMessage,&mh,std::placeholders::_1));

Using namespace

h.socket("/chat")->emit("add user", username);

** Full overview of API can be seen here **



Related Repositories

C++11 implementation of Socket.IO client ...



ofx addons that wraps for OF ...

Sample of Socket.IO C++ Client. ...

Top Contributors

melode11 macq-vraman hfossli Magic07 lniccoli francoisvdv nuclearace laneysmith mehanig yas llamerada-jp yandod NuclearCookie


-   1.6.1 zip tar
-   1.6.0 zip tar
-   1.5.0 zip tar
-   1.4.1 zip tar
-   1.4.0 zip tar
-   1.3.3 zip tar
-   1.3.2 zip tar
-   1.3.1 zip tar
-   1.3.0 zip tar
-   1.3.0-alpha1 zip tar
-   1.2.2 zip tar
-   1.2.1 zip tar
-   1.2.0 zip tar
-   1.1.1 zip tar
-   1.1.0 zip tar
-   1.0.0-alpha2 zip tar
-   1.0.0-alpha1 zip tar