Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Build socket.io library for native SDKs

Johny Qiu edited this page May 19, 2021 · 10 revisions

OWT native SDK currently uses socket.io as the signaling protocol so it is depending on 2.0 version of socket.io-client-cpp project.

P2P SDK is not implemented directly depending on socket.io, rather, the signaling channel implementation is provided by the sample application, so P2P SDK will not link to socket.io library, nor will it use socket.io headers. But since owt-server-p2p, which is the signaling server, is using socket.io, so your P2P application will need to link to socket.io library as well.

Conference SDK is implemented with signaling channel implementation embedded in the SDK, and it is using version 2.0 of the socket.io headers. socket.io library binary will not be packed into OWT SDK binary, you will have to explicitly link to it in your application.

Build Instructions

Linux

Your conference application must use below commands to build 2.0 version of socket.io library for Linux. cmake 2.8 and above is required for generation of build files for both Linux and Windows.

  git clone --recurse-submodules https://github.com/socketio/socket.io-client-cpp.git -b 2.x
  cd socket.io-client-cpp
  mkdir build
  cd build
  cmake ../
  make

Windows

Build process of 2.0 version of socket.io on windows is basically the same as Linux except the final step. On Windows a .sln file will be generated. depending on the VC runtime to be used for you application, you may specify VC runtime for all projects in this solution to either /MD, /MT, /MDd or /MTd. By default the OWT Windows SDK is built with /MT for release build, and /MTd for debug builds, so the socket.io solution will need to be configured accordingly.

Support TLS

The socket.io library is implemented with limited TLS support. You can build socket.io library with TLS support.

Windows

When running cmake, you will need to include path to openssl binary. For example,
cmake ../ -DOPENSSL_ROOT_DIR:STRING=c:\ssl_111k_64.
This requires ssl_111k_64 to contain a prebuilt binary of openssl library, where the build process is trying to access lib and include directory, as well as openssl.conf under that directory.

A sioclient_tls.vcxproj, besides the sioclient.vcxproj will be generated under sioclient.sln when OPENSSL_ROOT_DIR is specified and openssl headers can be found under specified OPENSSL_ROOT_DIR. After you build sioclient.sln, both sioclient.lib(without TLS support) and siocleint_tls.lib(with TLS support) will be created,

Special notes for openssl verison:

  • You should use the latest version of 1.1.1 openssl libraries for linking to sioclient_tls.
  • If you link to TLS version of sioclient library, OWT SDK must be built with owt_use_openssl=true in gn args. (passing ssl_root to build script). If you don't build OWT with openssl (instead using boringssl), you application will fail to link due to ssl symbol conflicts.

Linux

You don't need to specify OPENSSL_ROOT_DIR when running cmake, but you need to make sure 1.1.1 openssl library will be found by pkg-config --cflags --libs openssl before running cmake.

Clone this wiki locally