This project has not been tested with anything after Socket.IO 0.8.
- Make sure you have the boost libararies installed.
- Include websocket++, rapidjson and
socket_io_client.cppin your project.
socket_io_client.hppwhere you want to use it.
The minimal amount of code needed to make a connection to a Socket.IO server is as follows:
socketio_client_handler_ptr handler(new socketio_client_handler()); client endpoint(handler); client::connection_ptr con = endpoint.get_connection(handler->perform_handshake("ws://localhost:8080"));
For examples of event binding and additional settings, see the sample code in the msvc folder.
Namespaces and Endpoints
To connect to a namespace, after doing the handshake and when the handler is ready, call
connect_endpoint("\endpointName"). See the example for more details.
Socket.io-client++-specific source is released under the BSD license.