Deployed 7ad5ead with MkDocs version: 1.1.2
This commit is contained in:
committed
1 parent
97ac808c6b
commit
85590bf4b6
4 files changed
+16
-2
No files matched your search
+1
-1
@@ -265,5 +265,5 @@ webSocket.send("hello world");
|
||||
|
||||
<!--
|
||||
MkDocs version : 1.1.2
|
||||
Build Date UTC : 2020-08-14 05:11:19.088216+00:00
|
||||
Build Date UTC : 2020-08-14 22:16:20.903224+00:00
|
||||
-->
|
||||
@@ -1 +1 @@
|
||||
{"config":{"lang":["en"],"min_search_length":3,"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 liLine truncated
|
||||
{"config":{"lang":["en"],"min_search_length":3,"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 liLine truncated
|
||||
Binary file not shown.
@@ -323,6 +323,20 @@ Listening on 127.0.0.1:8008
|
||||
</code></pre>
|
||||
|
||||
<p>If you connect to ws://127.0.0.1:8008, the proxy will connect to ws://127.0.0.1:9000 and pass all traffic to this server.</p>
|
||||
<p>You can also use a more complex setup if you want to redirect to different websocket servers based on the hostname your client is trying to connect to. If you have multiple CNAME aliases that point to the same server.</p>
|
||||
<p>A JSON config file is used to express that mapping ; here connecting to echo.jeanserge.com will proxy the client to ws://localhost:8008 on the local machine (which actually runs ws echo_server), while connecting to bavarde.jeanserge.com will proxy the client to ws://localhost:5678 where a cobra python server is running. As a side note you will need a wildcard SSL certificate if you want to have SSL enabled on that machine.</p>
|
||||
<pre><code class="json">{
|
||||
"remote_urls": {
|
||||
"echo.jeanserge.com": "ws://localhost:8008",
|
||||
"bavarde.jeanserge.com": "ws://localhost:5678"
|
||||
}
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
<p>The --config_path option is required to instruct ws proxy_server to read that file.</p>
|
||||
<pre><code>ws proxy_server --config_path proxyConfig.json --port 8765
|
||||
</code></pre>
|
||||
|
||||
<h2 id="file-transfer">File transfer</h2>
|
||||
<pre><code># Start transfer server, which is just a broadcast server at this point
|
||||
ws transfer # running on port 8080.
|
||||
|
||||
Reference in new issue
Block a user