Home

Awesome

This project has moved to https://gitlab.com/eidheim/Simple-WebSocket-Server.

Simple-WebSocket-Server

A very simple, fast, multithreaded, platform independent WebSocket (WS) and WebSocket Secure (WSS) server and client library implemented using C++11, Asio (both Boost.Asio and standalone Asio can be used) and OpenSSL. Created to be an easy way to make WebSocket endpoints in C++.

See https://gitlab.com/eidheim/Simple-Web-Server for an easy way to make REST resources available from C++ applications. Also, feel free to check out the new C++ IDE supporting C++11/14/17: https://gitlab.com/cppit/jucipp.

Features

Usage

See ws_examples.cpp or wss_examples.cpp for example usage.

Dependencies

Compile

Compile with a C++11 supported compiler:

mkdir build
cd build
cmake ..
make
cd ..

Run server and client examples

WS

./build/ws_examples

WSS

Before running the WSS-examples, an RSA private key (server.key) and an SSL certificate (server.crt) must be created. Follow, for instance, the instructions given here (for a self-signed certificate): http://www.akadia.com/services/ssh_test_certificate.html

Then:

./build/wss_examples