+ + + + Changelog All changes to this project will be documented in this file. [9.1.9] - 2020-03-30 (cobra to statsd bot) add ability to extract a numerical value and send a timer event to statsd, with the --timer option @@ -1118,84 +2768,81 @@ ws_connect: connection closed: code 1000 reason Normal closure ws command line tool build on Windows Async API for HttpClient HttpClient API changed to use shared_ptr for response and request -
+ + + + Build + + Build CMake CMakefiles for the library and the examples are available. This library has few dependencies, so it is possible to just add the source files into your project. Otherwise the usual way will suffice. mkdir build # make a build dir so that you can build out of tree. @@ -157,84 +461,81 @@ $ docker exec -it ixwebsocket_ws_1 bash app@ca2340eb9106:~$ ws --help ws is a websocket tool ... -
+ + + + Cobra + + General cobra is a real time messaging server. The ws utility can run a cobra server (named snake), and has client to publish and subscribe to a cobra server. Bring up 3 terminals and run a server, a publisher and a subscriber in each one. As you publish data you should see it being received by the subscriber. You can run redis-cli MONITOR too to see how redis is being used. Server @@ -172,84 +462,81 @@ $ ws cobra_publish --appkey FC2F10139A2BAc53BB72D9db967b024f --endpoint ws://127 #messages 4 msg/s 1 ^C -
+ + + + Design + + Implementation details Per Message Deflate compression. The per message deflate compression option is supported. It can lead to very nice bandbwith savings (20x !) if your messages are similar, which is often the case for example for chat applications. All features of the spec should be supported. TLS/SSL @@ -168,84 +518,81 @@ | IXDNSLookup | Does DNS resolution asynchronously so that it can be interrupted. | | +-----------------------+ -
+ + + + Home + + Introduction WebSocket is a computer communications protocol, providing full-duplex and bi-directionnal communication channels over a single TCP connection. IXWebSocket is a C++ library for client and server Websocket communication, and for client and server HTTP communication. TLS aka SSL is supported. The code is derived from easywsclient and from the Satori C SDK. It has been tested on the following platforms. @@ -179,89 +451,67 @@ webSocket.send("hello world"); µWebSockets - C Contributing -IXWebSocket is developed on GitHub. We'd love to hear about how you use it; opening up an issue on GitHub is ok for that. If things don't work as expected, please create an issue on GitHub, or even better a pull request if you know how to fix your problem.
+ + + + Packages + + Notes on how we can update the different packages for ixwebsocket. VCPKG Visit the releases page on Github. A tag must have been made first. Download the latest entry. @@ -184,84 +420,81 @@ Branch 'feature/ixwebsocket_9.1.9' set up to track remote branch 'feature/ixwebs vcpkg$ -Just visit this url, https://github.com/bsergean/vcpkg/pull/new/feature/ixwebsocket_9.1.9, printed on the console, to make the pull request.
+ + + + Examples The ws folder countains many interactive programs for chat, file transfers, curl like http clients, demonstrating client and server usage. Windows note To use the network system on Windows, you need to initialize it once with WSAStartup() and clean it up with WSACleanup(). We have helpers for that which you can use, see below. This init would typically take place in your main function. @@ -156,7 +608,7 @@ webSocket.setUrl(url); // Optional heart beat, sent every 45 seconds when there is not any traffic // to make sure that load balancers do not kill an idle connection. -webSocket.setHeartBeatPeriod(45); +webSocket.setPingInterval(45); // Per message deflate connection is enabled by default. You can tweak its parameters or disable it webSocket.disablePerMessageDeflate(); @@ -274,7 +726,7 @@ websocket.configure(url); You can configure an optional heart beat / keep-alive, sent every 45 seconds when there is no any traffic to make sure that load balancers do not kill an idle connection. -webSocket.setHeartBeatPeriod(45); +webSocket.setPingInterval(45); Supply extra HTTP headers. @@ -531,84 +983,81 @@ server.wait(); For a client, specifying caFile can be used if connecting to a server that uses a self-signed cert, or when using a custom CA in an internal environment. For a server, specifying caFile implies that: 1. You require clients to present a certificate -1. It must be signed by one of the trusted roots in the file
+ + + + Ws + + General ws is a command line tool that should exercise most of the IXWebSocket code, and provide example code. ws is a websocket tool Usage: ws [OPTIONS] SUBCOMMAND @@ -467,84 +757,67 @@ $ ws cobra_publish --endpoint wss://127.0.0.1:8765 --appkey FC2F10139A2BAc53BB72 [2019-12-19 20:46:42.659] [info] Published message id 3 acked -To use OpenSSL on macOS, compile with make ws_openssl. First you will have to install OpenSSL libraries, which can be done with Homebrew. Use make ws_mbedtls accordingly to use MbedTLS.