Deployed 2802cad with MkDocs version: 1.1

This commit is contained in:
committed 2020-04-24 22:51:16 +00:00
1 parent 8f8d9e79bc
commit 99c1e62c9e
7 files changed
+20 -14

No files matched your search

+6
View File
@@ -95,6 +95,10 @@
<li class="nav-item" data-level="1"><a href="#changelog" class="nav-link">Changelog</a> <li class="nav-item" data-level="1"><a href="#changelog" class="nav-link">Changelog</a>
<ul class="nav flex-column"> <ul class="nav flex-column">
<li class="nav-item" data-level="2"><a href="#940-2020-04-24" class="nav-link">[9.4.0] - 2020-04-24</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="2"><a href="#933-2020-04-17" class="nav-link">[9.3.3] - 2020-04-17</a> <li class="nav-item" data-level="2"><a href="#933-2020-04-17" class="nav-link">[9.3.3] - 2020-04-17</a>
<ul class="nav flex-column"> <ul class="nav flex-column">
</ul> </ul>
@@ -688,6 +692,8 @@
<h1 id="changelog">Changelog</h1> <h1 id="changelog">Changelog</h1>
<p>All changes to this project will be documented in this file.</p> <p>All changes to this project will be documented in this file.</p>
<h2 id="940-2020-04-24">[9.4.0] - 2020-04-24</h2>
<p>(ssl) Add support for supplying SSL CA from memory, for OpenSSL and MbedTLS backends</p>
<h2 id="933-2020-04-17">[9.3.3] - 2020-04-17</h2> <h2 id="933-2020-04-17">[9.3.3] - 2020-04-17</h2>
<p>(ixbots) display sent/receive message, per seconds as accumulated</p> <p>(ixbots) display sent/receive message, per seconds as accumulated</p>
<h2 id="932-2020-04-17">[9.3.2] - 2020-04-17</h2> <h2 id="932-2020-04-17">[9.3.2] - 2020-04-17</h2>
+1 -2
View File
@@ -137,8 +137,7 @@
</ul> </ul>
<h2 id="limitations">Limitations</h2> <h2 id="limitations">Limitations</h2>
<ul> <ul>
<li>On Windows and Android certificate validation needs to be setup so that SocketTLSOptions.caFile point to a pem file, such as the one distributed by Firefox. Unless that setup is done connecting to a wss endpoint will display an error. On Windows with mbedtls the message will contain <code>error in handshake : X509 - Certificate verification failed, e.g. CRL, CA or signature check failed</code>.</li> <li>On some configuration (mostly Android) certificate validation needs to be setup so that SocketTLSOptions.caFile point to a pem file, such as the one distributed by Firefox. Unless that setup is done connecting to a wss endpoint will display an error. With mbedtls the message will contain <code>error in handshake : X509 - Certificate verification failed, e.g. CRL, CA or signature check failed</code>.</li>
<li>There is no convenient way to embed a ca cert.</li>
<li>Automatic reconnection works at the TCP socket level, and will detect remote end disconnects. However, if the device/computer network become unreachable (by turning off wifi), it is quite hard to reliably and timely detect it at the socket level using <code>recv</code> and <code>send</code> error codes. <a href="https://stackoverflow.com/questions/14782143/linux-socket-how-to-detect-disconnected-network-in-a-client-program">Here</a> is a good discussion on the subject. This behavior is consistent with other runtimes such as node.js. One way to detect a disconnected device with low level C code is to do a name resolution with DNS but this can be expensive. Mobile devices have good and reliable API to do that.</li> <li>Automatic reconnection works at the TCP socket level, and will detect remote end disconnects. However, if the device/computer network become unreachable (by turning off wifi), it is quite hard to reliably and timely detect it at the socket level using <code>recv</code> and <code>send</code> error codes. <a href="https://stackoverflow.com/questions/14782143/linux-socket-how-to-detect-disconnected-network-in-a-client-program">Here</a> is a good discussion on the subject. This behavior is consistent with other runtimes such as node.js. One way to detect a disconnected device with low level C code is to do a name resolution with DNS but this can be expensive. Mobile devices have good and reliable API to do that.</li>
<li>The server code is using select to detect incoming data, and creates one OS thread per connection. This is not as scalable as strategies using epoll or kqueue.</li> <li>The server code is using select to detect incoming data, and creates one OS thread per connection. This is not as scalable as strategies using epoll or kqueue.</li>
</ul> </ul>
+1 -1
View File
@@ -263,5 +263,5 @@ webSocket.send(&quot;hello world&quot;);
<!-- <!--
MkDocs version : 1.1 MkDocs version : 1.1
Build Date UTC : 2020-04-22 21:14:51 Build Date UTC : 2020-04-24 22:51:16
--> -->
+1 -1
View File
@@ -1 +1 @@
{"config":{"lang":["en"],"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"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. macOS iOS Linux Android Windows FreeBSD Example code // Required on Windows ix::initNetSystem(); // Our websocket object ix::WebSocket webSocket; std::string url(\"ws://localhost:8080/\"); webSocket.setUrl(url); // Setup a callback to be fired when a message or an event (open, close, error) is received webSocket.setOnMessageCallback([](const ix::WebSocketMessagePtr& msg) { if (msg->type == ix::WebSocketMessageType::Message) { std::cout << msg->str << std::endl; } } ); // Now that our callback is setup, we can start our background thread and receive messages webSocket.start(); // Send a message to the server (default to TEXT mode) webSocket.send(\"hello world\"); Why another library? There are 2 main reasons that explain why IXWebSocket got written. First, we needed a C++ cross-platform client library, which should have few dependencies. What looked like the most solid one, websocketpp did depend on boost and this was not an option for us. Secondly, there were other available libraries with fewer dependencies (C ones), but they required calling an explicit poll routine periodically to know if a client had received data from a server, which was not elegant. We started by solving those 2 problems, then we added server websocket code, then an HTTP client, and finally a very simple HTTP server. IXWebSocket comes with a command line utility named ws which is quite handy, and is now packaged with alpine linux. You can install it with apk add ws . Few dependencies (only zlib) Simple to use ; uses std::string and std::function callbacks. Complete support of the websocket protocol, and basic http support. Client and Server TLS support Alternative libraries There are plenty of great websocket libraries out there, which might work for you. Here are a couple of serious ones. websocketpp - C++ beast - C++ libwebsockets - C \u00b5WebSockets - 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.","title":"Home"},{"location":"#introduction","text":"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. macOS iOS Linux Android Windows FreeBSD","title":"Introduction"},{"location":"#example-code","text":"// Required on Windows ix::initNetSystem(); // Our websocket object ix::WebSocket webSocket; std::string url(\"ws://localhost:8080/\"); webSocket.setUrl(url); // Setup a callback to be fired when a message or an event (open, close, error) is received webSocket.setOnMessageCallback([](const ix::WebSocketMessagePtr& msg) { if (msg->type == ix::WebSocketMessageType::Message) { std::cout << msg->str << std::endl; } } ); // Now that our callback is setup, we can start our background thread and receive messages webSocket.start(); // Send a message to the server (default to TEXT mode) webSocket.send(\"hello world\");","title":"Example code"},{"location":"#why-another-library","text":"There are 2 main reasons that explain why IXWebSocket got written. First, we needed a C++ cross-platform client library, which should have few dependencies. What looked like the most solid one, websocketpp did depend on boost and this was not an option for us. Secondly, there were other available libraries with fewer dependencies (C ones), but they required calling an explicit poll routine periodically to know if a client had received data from a server, which was not elegant. We started by solving those 2 problems, then we added server websocket code, then an HTTP client, and finally a very simple HTTP server. IXWebSocket comes with a command line utility named ws which is quite handy, and is now packaged with alpine linux. You can install it with apk add ws . Few dependencies (only zlib) Simple to use ; uses std::string and std::function callbacks. Complete support of the websocket protocol, and basic http support. Client and Server TLS support","title":"Why another library?"},{"location":"#alternative-libraries","text":"There are plenty of great websocket libraries out there, whiLine truncated {"config":{"lang":["en"],"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"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. macOS iOS Linux Android Windows FreeBSD Example code // Required on Windows ix::initNetSystem(); // Our websocket object ix::WebSocket webSocket; std::string url(\"ws://localhost:8080/\"); webSocket.setUrl(url); // Setup a callback to be fired when a message or an event (open, close, error) is received webSocket.setOnMessageCallback([](const ix::WebSocketMessagePtr& msg) { if (msg->type == ix::WebSocketMessageType::Message) { std::cout << msg->str << std::endl; } } ); // Now that our callback is setup, we can start our background thread and receive messages webSocket.start(); // Send a message to the server (default to TEXT mode) webSocket.send(\"hello world\"); Why another library? There are 2 main reasons that explain why IXWebSocket got written. First, we needed a C++ cross-platform client library, which should have few dependencies. What looked like the most solid one, websocketpp did depend on boost and this was not an option for us. Secondly, there were other available libraries with fewer dependencies (C ones), but they required calling an explicit poll routine periodically to know if a client had received data from a server, which was not elegant. We started by solving those 2 problems, then we added server websocket code, then an HTTP client, and finally a very simple HTTP server. IXWebSocket comes with a command line utility named ws which is quite handy, and is now packaged with alpine linux. You can install it with apk add ws . Few dependencies (only zlib) Simple to use ; uses std::string and std::function callbacks. Complete support of the websocket protocol, and basic http support. Client and Server TLS support Alternative libraries There are plenty of great websocket libraries out there, which might work for you. Here are a couple of serious ones. websocketpp - C++ beast - C++ libwebsockets - C \u00b5WebSockets - 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.","title":"Home"},{"location":"#introduction","text":"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. macOS iOS Linux Android Windows FreeBSD","title":"Introduction"},{"location":"#example-code","text":"// Required on Windows ix::initNetSystem(); // Our websocket object ix::WebSocket webSocket; std::string url(\"ws://localhost:8080/\"); webSocket.setUrl(url); // Setup a callback to be fired when a message or an event (open, close, error) is received webSocket.setOnMessageCallback([](const ix::WebSocketMessagePtr& msg) { if (msg->type == ix::WebSocketMessageType::Message) { std::cout << msg->str << std::endl; } } ); // Now that our callback is setup, we can start our background thread and receive messages webSocket.start(); // Send a message to the server (default to TEXT mode) webSocket.send(\"hello world\");","title":"Example code"},{"location":"#why-another-library","text":"There are 2 main reasons that explain why IXWebSocket got written. First, we needed a C++ cross-platform client library, which should have few dependencies. What looked like the most solid one, websocketpp did depend on boost and this was not an option for us. Secondly, there were other available libraries with fewer dependencies (C ones), but they required calling an explicit poll routine periodically to know if a client had received data from a server, which was not elegant. We started by solving those 2 problems, then we added server websocket code, then an HTTP client, and finally a very simple HTTP server. IXWebSocket comes with a command line utility named ws which is quite handy, and is now packaged with alpine linux. You can install it with apk add ws . Few dependencies (only zlib) Simple to use ; uses std::string and std::function callbacks. Complete support of the websocket protocol, and basic http support. Client and Server TLS support","title":"Why another library?"},{"location":"#alternative-libraries","text":"There are plenty of great websocket libraries out there, whiLine truncated
+8 -8
View File
@@ -1,35 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url>
<loc>None</loc> <loc>None</loc>
<lastmod>2020-04-22</lastmod> <lastmod>2020-04-24</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url><url> </url><url>
<loc>None</loc> <loc>None</loc>
<lastmod>2020-04-22</lastmod> <lastmod>2020-04-24</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url><url> </url><url>
<loc>None</loc> <loc>None</loc>
<lastmod>2020-04-22</lastmod> <lastmod>2020-04-24</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url><url> </url><url>
<loc>None</loc> <loc>None</loc>
<lastmod>2020-04-22</lastmod> <lastmod>2020-04-24</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url><url> </url><url>
<loc>None</loc> <loc>None</loc>
<lastmod>2020-04-22</lastmod> <lastmod>2020-04-24</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url><url> </url><url>
<loc>None</loc> <loc>None</loc>
<lastmod>2020-04-22</lastmod> <lastmod>2020-04-24</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url><url> </url><url>
<loc>None</loc> <loc>None</loc>
<lastmod>2020-04-22</lastmod> <lastmod>2020-04-24</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url><url> </url><url>
<loc>None</loc> <loc>None</loc>
<lastmod>2020-04-22</lastmod> <lastmod>2020-04-24</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
</urlset> </urlset>
BIN
View File
Binary file not shown.
+3 -2
View File
@@ -518,7 +518,7 @@ server.wait();
<pre><code class="cpp">webSocket.setTLSOptions({ <pre><code class="cpp">webSocket.setTLSOptions({
.certFile = &quot;path/to/cert/file.pem&quot;, .certFile = &quot;path/to/cert/file.pem&quot;,
.keyFile = &quot;path/to/key/file.pem&quot;, .keyFile = &quot;path/to/key/file.pem&quot;,
.caFile = &quot;path/to/trust/bundle/file.pem&quot;, .caFile = &quot;path/to/trust/bundle/file.pem&quot;, // as a file, or in memory buffer in PEM format
.tls = true // required in server mode .tls = true // required in server mode
}); });
</code></pre> </code></pre>
@@ -528,7 +528,8 @@ server.wait();
<p>On a server, this is necessary for TLS support.</p> <p>On a server, this is necessary for TLS support.</p>
<p>Specifying <code>caFile</code> configures the trusted roots bundle file (in PEM format) that will be used to verify peer certificates. <p>Specifying <code>caFile</code> configures the trusted roots bundle file (in PEM format) that will be used to verify peer certificates.
- The special value of <code>SYSTEM</code> (the default) indicates that the system-configured trust bundle should be used; this is generally what you want when connecting to any publicly exposed API/server. - The special value of <code>SYSTEM</code> (the default) indicates that the system-configured trust bundle should be used; this is generally what you want when connecting to any publicly exposed API/server.
- The special value of <code>NONE</code> can be used to disable peer verification; this is only recommended to rule out certificate verification when testing connectivity.</p> - The special value of <code>NONE</code> can be used to disable peer verification; this is only recommended to rule out certificate verification when testing connectivity.
- If the value contain the special value <code>-----BEGIN CERTIFICATE-----</code>, the value will be read from memory, and not from a file. This is convenient on platforms like Android where reading / writing to the file system can be challenging without proper permissions, or without knowing the location of a temp directory.</p>
<p>For a client, specifying <code>caFile</code> can be used if connecting to a server that uses a self-signed cert, or when using a custom CA in an internal environment.</p> <p>For a client, specifying <code>caFile</code> can be used if connecting to a server that uses a self-signed cert, or when using a custom CA in an internal environment.</p>
<p>For a server, specifying <code>caFile</code> implies that: <p>For a server, specifying <code>caFile</code> implies that:
1. You require clients to present a certificate 1. You require clients to present a certificate