Skip to content
ofx addons that wraps for OF
Branch: master
Clone or download
Latest commit 6281112 Feb 26, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
example add example Feb 19, 2018
libs/ add compiled linuxarmv6l libs Apr 18, 2016
src Add getVector support Feb 19, 2018
.gitignore Nice WIP on data access Feb 10, 2016
LICENSE basic behaviour Feb 10, 2016 Credit @jedahan for his work Feb 26, 2018
ofxaddons_thumbnail.png Update README Feb 14, 2016



ofxSocketIO is an ofxaddon that wraps It is still under active development.


ofxSocketIO provides the compiled libraries for osx and linux64 out of the box. If you have to compile yourself, follow the installation instructions.

TLS/SSL compiles with SSL support by default. However, we had issues with certificates and thus removed the SSL support. The provided libs (osx and linux64) does not support TLS/SSL.

FYI, we simply removed the find_package(OpenSSL) call in the CMakeLists.txt.


Take a look at our example.

You'll need a server to communicate with. (check out our test server)



setup(std::string& address)

→ Creates a websocket connection with the address remote.

bindEvent(ofEvent<ofxSocketIOData&>& event, std::string eventName)

→ Binds an ofEvent to string trigger. Typically, you'd do:

std::string eventName = "server-event";
socketIO.bindEvent(serverEvent, eventName);
ofAddListener(serverEvent, this, &ofApp::onServerEvent);

void ofApp::onServerEvent (ofxSocketIOData& data) {
  // Will be triggered when the server emits a "server-event" event
  // See the `ofxSocketIOData` API on how to use the `data` parameter here

→ Returns the current status. Either connected, closed, reconnecting or errored.


→ An ofEvent triggered when the socket is connected to the server


→ An ofEvent triggered when the socket is connected, closed, errored, or when the socket is trying to reconnect. Comes with std::string status parameter.

emit(std::string& eventName, std::string& data)

→ Emits an event with the specified event name and a string parameter (you'll have to cast your non-string datas).


→ Force closes the socket.


getStringValue(std::string key)

→ Get the std::string value for the specified key.

getIntValue(std::string key)

→ Get the int value for the specified key.

getFloatValue(std::string key)

→ Get the float value for the specified key.

getDoubleValue(std::string key)

→ Get the double value for the specified key.

getBoolValue(std::string key)

→ Get the bool value for the specified key.


→ Get the raw vector if the message is not a map.


ping pong

You may experience issues with 'ping' and 'pong' events, as they are used internally by

- `ping`. Fired when a ping packet is written out to the server.
- `pong`. Fired when a pong is received from the server.



ofxSocketIO is maintained by Soixante circuits and hugohil.

It exists thanks to the great work of the contributors.

These folks have made some useful contributions to ofxSocketIO too:



You can’t perform that action at this time.