261 lines
12 KiB
HTML
261 lines
12 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
|
|
|
|
<link rel="shortcut icon" href="../img/favicon.ico">
|
|
<title>Build - IXWebSocket</title>
|
|
<link href="../css/bootstrap.min.css" rel="stylesheet">
|
|
<link href="../css/font-awesome.min.css" rel="stylesheet">
|
|
<link href="../css/base.css" rel="stylesheet">
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css">
|
|
|
|
<script src="../js/jquery-1.10.2.min.js" defer></script>
|
|
<script src="../js/bootstrap.min.js" defer></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
|
|
<script>hljs.initHighlightingOnLoad();</script>
|
|
</head>
|
|
|
|
<body>
|
|
<div class="navbar fixed-top navbar-expand-lg navbar-dark bg-primary">
|
|
<div class="container">
|
|
<a class="navbar-brand" href="..">IXWebSocket</a>
|
|
<!-- Expander button -->
|
|
<button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#navbar-collapse">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
|
|
<!-- Expanded navigation -->
|
|
<div id="navbar-collapse" class="navbar-collapse collapse">
|
|
<!-- Main navigation -->
|
|
<ul class="nav navbar-nav">
|
|
<li class="navitem">
|
|
<a href=".." class="nav-link">Home</a>
|
|
</li>
|
|
<li class="navitem">
|
|
<a href="../CHANGELOG/" class="nav-link">Changelog</a>
|
|
</li>
|
|
<li class="navitem active">
|
|
<a href="./" class="nav-link">Build</a>
|
|
</li>
|
|
<li class="navitem">
|
|
<a href="../cobra/" class="nav-link">Cobra</a>
|
|
</li>
|
|
<li class="navitem">
|
|
<a href="../design/" class="nav-link">Design</a>
|
|
</li>
|
|
<li class="navitem">
|
|
<a href="../packages/" class="nav-link">Packages</a>
|
|
</li>
|
|
<li class="navitem">
|
|
<a href="../performance/" class="nav-link">Performance</a>
|
|
</li>
|
|
<li class="navitem">
|
|
<a href="../usage/" class="nav-link">Examples</a>
|
|
</li>
|
|
<li class="navitem">
|
|
<a href="../ws/" class="nav-link">Ws</a>
|
|
</li>
|
|
</ul>
|
|
|
|
<ul class="nav navbar-nav ml-auto">
|
|
<li class="nav-item">
|
|
<a href="#" class="nav-link" data-toggle="modal" data-target="#mkdocs_search_modal">
|
|
<i class="fa fa-search"></i> Search
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a rel="prev" href="../CHANGELOG/" class="nav-link">
|
|
<i class="fa fa-arrow-left"></i> Previous
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a rel="next" href="../cobra/" class="nav-link">
|
|
Next <i class="fa fa-arrow-right"></i>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="container">
|
|
<div class="row">
|
|
<div class="col-md-3"><div class="navbar-light navbar-expand-md bs-sidebar hidden-print affix" role="complementary">
|
|
<div class="navbar-header">
|
|
<button type="button" class="navbar-toggler collapsed" data-toggle="collapse" data-target="#toc-collapse" title="Table of Contents">
|
|
<span class="fa fa-angle-down"></span>
|
|
</button>
|
|
</div>
|
|
|
|
|
|
<div id="toc-collapse" class="navbar-collapse collapse card bg-secondary">
|
|
<ul class="nav flex-column">
|
|
|
|
<li class="nav-item" data-level="2"><a href="#build" class="nav-link">Build</a>
|
|
<ul class="nav flex-column">
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div></div>
|
|
<div class="col-md-9" role="main">
|
|
|
|
<h2 id="build">Build</h2>
|
|
<h3 id="cmake">CMake</h3>
|
|
<p>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.</p>
|
|
<pre><code>mkdir build # make a build dir so that you can build out of tree.
|
|
cd build
|
|
cmake -DUSE_TLS=1 ..
|
|
make -j
|
|
make install # will install to /usr/local on Unix, on macOS it is a good idea to sudo chown -R `whoami`:staff /usr/local
|
|
</code></pre>
|
|
|
|
<p>Headers and a static library will be installed to the target dir.
|
|
There is a unittest which can be executed by typing <code>make test</code>.</p>
|
|
<p>Options for building:</p>
|
|
<ul>
|
|
<li><code>-DUSE_ZLIB=1</code> will enable zlib support, required for http client + server + websocket per message deflate extension</li>
|
|
<li><code>-DUSE_TLS=1</code> will enable TLS support</li>
|
|
<li><code>-DUSE_OPEN_SSL=1</code> will use <a href="https://www.openssl.org/">openssl</a> for the TLS support (default on Linux and Windows)</li>
|
|
<li><code>-DUSE_MBED_TLS=1</code> will use <a href="https://tls.mbed.org/">mbedlts</a> for the TLS support</li>
|
|
<li><code>-DUSE_WS=1</code> will build the ws interactive command line tool</li>
|
|
<li><code>-DUSE_TEST=1</code> will build the unittest</li>
|
|
<li><code>-DUSE_PYTHON=1</code> will use Python3 for cobra bots, require Python3 to be installed.</li>
|
|
</ul>
|
|
<p>If you are on Windows, look at the <a href="https://github.com/machinezone/IXWebSocket/blob/master/appveyor.yml">appveyor</a> file (not maintained much though) or rather the <a href="https://github.com/machinezone/IXWebSocket/blob/master/.github/workflows/unittest_windows.yml">github actions</a> which have instructions for building dependencies.</p>
|
|
<p>It is also possible to externally include the project, so that everything is fetched over the wire when you build like so:</p>
|
|
<pre><code> ExternalProject_Add(
|
|
IXWebSocket
|
|
GIT_REPOSITORY https://github.com/machinezone/IXWebSocket.git
|
|
...
|
|
)
|
|
</code></pre>
|
|
|
|
<h3 id="vcpkg">vcpkg</h3>
|
|
<p>It is possible to get IXWebSocket through Microsoft <a href="https://github.com/microsoft/vcpkg">vcpkg</a>.</p>
|
|
<pre><code>vcpkg install ixwebsocket
|
|
</code></pre>
|
|
|
|
<p>To use the installed package within a cmake project, use the following:</p>
|
|
<pre><code class="cmake"> set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "") # this is super important in order for cmake to include the vcpkg search/lib paths!
|
|
|
|
# find library and its headers
|
|
find_path(IXWEBSOCKET_INCLUDE_DIR ixwebsocket/IXWebSocket.h)
|
|
find_library(IXWEBSOCKET_LIBRARY ixwebsocket)
|
|
# include headers
|
|
include_directories(${IXWEBSOCKET_INCLUDE_DIR})
|
|
# ...
|
|
target_link_libraries(${PROJECT_NAME} ... ${IXWEBSOCKET_LIBRARY}) # Cmake will automatically fail the generation if the lib was not found, i.e is set to NOTFOUNS
|
|
|
|
</code></pre>
|
|
|
|
<h3 id="conan">Conan</h3>
|
|
<p><a href="https://bintray.com/conan/conan-center/ixwebsocket%3A_/_latestVersion"> <img alt="Download" src="https://api.bintray.com/packages/conan/conan-center/ixwebsocket%3A_/images/download.svg" /> </a></p>
|
|
<p>Conan is currently supported through a recipe in <a href="https://github.com/conan-io/conan-center-index/tree/master/recipes/ixwebsocket">Conan Center</a> (<a href="https://bintray.com/conan/conan-center/ixwebsocket%3A_">Bintray entry</a>).</p>
|
|
<p>Package reference</p>
|
|
<ul>
|
|
<li>Conan 1.21.0 and up: <code>ixwebsocket/7.9.2</code></li>
|
|
<li>Earlier versions: <code>ixwebsocket/7.9.2@_/_</code></li>
|
|
</ul>
|
|
<p>Note that the version listed here might not be the latest one. See Bintray or the recipe itself for the latest version. If you're migrating from the previous, custom Bintray remote, note that the package reference <em>has</em> to be lower-case.</p>
|
|
<h3 id="docker">Docker</h3>
|
|
<p>There is a Dockerfile for running the unittest on Linux, and to run the <code>ws</code> tool. It is also available on the docker registry.</p>
|
|
<pre><code>docker run docker.pkg.github.com/machinezone/ixwebsocket/ws:latest --help
|
|
</code></pre>
|
|
|
|
<p>To use docker-compose you must make a docker container first.</p>
|
|
<pre><code>$ make docker
|
|
...
|
|
$ docker compose up &
|
|
...
|
|
$ docker exec -it ixwebsocket_ws_1 bash
|
|
app@ca2340eb9106:~$ ws --help
|
|
ws is a websocket tool
|
|
...
|
|
</code></pre></div>
|
|
</div>
|
|
</div>
|
|
|
|
<footer class="col-md-12">
|
|
<hr>
|
|
<p>Documentation built with <a href="https://www.mkdocs.org/">MkDocs</a>.</p>
|
|
</footer>
|
|
<script>
|
|
var base_url = "..",
|
|
shortcuts = {"help": 191, "next": 78, "previous": 80, "search": 83};
|
|
</script>
|
|
<script src="../js/base.js" defer></script>
|
|
<script src="../search/main.js" defer></script>
|
|
|
|
<div class="modal" id="mkdocs_search_modal" tabindex="-1" role="dialog" aria-labelledby="searchModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog modal-lg">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h4 class="modal-title" id="searchModalLabel">Search</h4>
|
|
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<p>
|
|
From here you can search these documents. Enter
|
|
your search terms below.
|
|
</p>
|
|
<form>
|
|
<div class="form-group">
|
|
<input type="search" class="form-control" placeholder="Search..." id="mkdocs-search-query" title="Type search term here">
|
|
</div>
|
|
</form>
|
|
<div id="mkdocs-search-results"></div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div><div class="modal" id="mkdocs_keyboard_modal" tabindex="-1" role="dialog" aria-labelledby="keyboardModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h4 class="modal-title" id="keyboardModalLabel">Keyboard Shortcuts</h4>
|
|
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th style="width: 20%;">Keys</th>
|
|
<th>Action</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td class="help shortcut"><kbd>?</kbd></td>
|
|
<td>Open this help</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="next shortcut"><kbd>n</kbd></td>
|
|
<td>Next page</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="prev shortcut"><kbd>p</kbd></td>
|
|
<td>Previous page</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="search shortcut"><kbd>s</kbd></td>
|
|
<td>Search</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="modal-footer">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</body>
|
|
</html>
|