Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eidheim/Simple-WebSocket-Server
A very simple, fast, multithreaded, platform independent WebSocket (WS) and WebSocket Secure (WSS) server and client library implemented using C++11, Boost.Asio and OpenSSL. Created to be an easy way to make WebSocket endpoints in C++.
https://github.com/eidheim/Simple-WebSocket-Server
asio client cpp library server websocket websocket-secure ws wss
Last synced: about 2 months ago
JSON representation
A very simple, fast, multithreaded, platform independent WebSocket (WS) and WebSocket Secure (WSS) server and client library implemented using C++11, Boost.Asio and OpenSSL. Created to be an easy way to make WebSocket endpoints in C++.
- Host: GitHub
- URL: https://github.com/eidheim/Simple-WebSocket-Server
- Owner: eidheim
- License: mit
- Archived: true
- Created: 2014-08-02T09:22:38.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-06-12T09:20:41.000Z (over 6 years ago)
- Last Synced: 2024-06-07T12:38:56.145Z (7 months ago)
- Topics: asio, client, cpp, library, server, websocket, websocket-secure, ws, wss
- Language: C++
- Homepage:
- Size: 363 KB
- Stars: 800
- Watchers: 81
- Forks: 279
- Open Issues: 27
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
**_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
* RFC 6455 mostly supported: text/binary frames, fragmented messages, ping-pong, connection close with status and reason.
* Asynchronous message handling
* Thread pool if needed
* Platform independent
* WebSocket Secure support
* Timeouts, if any of SocketServer::timeout_request and SocketServer::timeout_idle are >0 (default: SocketServer::timeout_request=5 seconds, and SocketServer::timeout_idle=0 seconds; no timeout on idle connections)
* Simple way to add WebSocket endpoints using regex for path, and anonymous functions
* An easy to use WebSocket and WebSocket Secure client library
* C++ bindings to the following OpenSSL methods: Base64, MD5, SHA1, SHA256 and SHA512 (found in crypto.hpp)### Usage
See ws_examples.cpp or wss_examples.cpp for example usage.
### Dependencies
* Boost.Asio or standalone Asio
* OpenSSL libraries### Compile
Compile with a C++11 supported compiler:
```sh
mkdir build
cd build
cmake ..
make
cd ..
```#### Run server and client examples
### WS
```sh
./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
```