WebSocket-Server
所属分类:网络编程
开发工具:Visual C++
文件大小:22KB
下载次数:136
上传日期:2015-12-29 17:10:16
上 传 者:
yangdaixu
说明: vc编写的websocket server 源码 ,支持http,https
(vc websocket server source code, supports http, https)
文件列表:
CMakeLists.txt (1745, 2015-12-15)
LICENSE (1088, 2015-12-15)
client_ws.hpp (19151, 2015-12-15)
client_wss.hpp (2739, 2015-12-15)
crypto.hpp (4505, 2015-12-15)
javascript_client_example.html (414, 2015-12-15)
server_ws.hpp (28817, 2015-12-15)
server_wss.hpp (2417, 2015-12-15)
test (0, 2015-12-15)
test\CMakeLists.txt (462, 2015-12-15)
test\crypto_test.cpp (5532, 2015-12-15)
test\parse_test.cpp (4250, 2015-12-15)
ws_examples.cpp (6923, 2015-12-15)
wss_examples.cpp (7089, 2015-12-15)
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++.
See also https://github.com/eidheim/Simple-Web-Server for an easy way to make REST resources available from C++ applications.
### Features
* RFC ***55 mostly supported: text/binary frames, ping-pong, connection close with status and reason.
* Thread pool
* 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: Base***, MD5, SHA1, SHA256 and SHA512 (found in crypto.hpp)
###Usage
See ws_examples.cpp or wss_examples.cpp for example usage.
### Dependencies
* Boost C++ libraries
* OpenSSL libraries
### Compile
Compile with a C++11 supported compiler:
```sh
cmake .
make
```
#### Run server and client examples
### WS
```sh
./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:
```
./wss_examples
```
近期下载者:
相关文件:
收藏者: