Giter Site home page Giter Site logo

machinezone / ixwebsocket Goto Github PK

View Code? Open in Web Editor NEW
493.0 11.0 158.0 14.96 MB

websocket and http client and server library, with TLS support and very few dependencies

License: BSD 3-Clause "New" or "Revised" License

C++ 95.61% CMake 1.16% Makefile 0.07% JavaScript 0.21% Shell 0.80% Python 1.80% C 0.01% Dockerfile 0.02% C# 0.20% Ruby 0.11% Procfile 0.01%
websockets http http-server websocket-client websocket-server cpp

ixwebsocket's Introduction

Hello world

(note from the main developer, sadly I don't have too much time to devote to this library anymore, maybe it's time to pass the maintenance to someone else more motivated ?)

IXWebSocket is a C++ library for WebSocket client and server development. It has minimal dependencies (no boost), is very simple to use and support everything you'll likely need for websocket dev (SSL, deflate compression, compiles on most platforms, etc...). HTTP client and server code is also available, but it hasn't received as much testing.

It is been used on big mobile video game titles sending and receiving tons of messages since 2017 (iOS and Android). It was tested on macOS, iOS, Linux, Android, Windows and FreeBSD. Two important design goals are simplicity and correctness.

/*
 *  main.cpp
 *  Author: Benjamin Sergeant
 *  Copyright (c) 2020 Machine Zone, Inc. All rights reserved.
 *
 *  Super simple standalone example. See ws folder, unittest and doc/usage.md for more.
 *
 *  On macOS
 *  $ mkdir -p build ; (cd build ; cmake -DUSE_TLS=1 .. ; make -j ; make install)
 *  $ clang++ --std=c++11 --stdlib=libc++ main.cpp -lixwebsocket -lz -framework Security -framework Foundation
 *  $ ./a.out
 *
 *  Or use cmake -DBUILD_DEMO=ON option for other platforms
 */

#include <ixwebsocket/IXNetSystem.h>
#include <ixwebsocket/IXWebSocket.h>
#include <ixwebsocket/IXUserAgent.h>
#include <iostream>

int main()
{
    // Required on Windows
    ix::initNetSystem();

    // Our websocket object
    ix::WebSocket webSocket;

    // Connect to a server with encryption
    // See https://machinezone.github.io/IXWebSocket/usage/#tls-support-and-configuration
    //     https://github.com/machinezone/IXWebSocket/issues/386#issuecomment-1105235227 (self signed certificates)
    std::string url("wss://echo.websocket.org");
    webSocket.setUrl(url);

    std::cout << "Connecting to " << url << "..." << std::endl;

    // Setup a callback to be fired (in a background thread, watch out for race conditions !)
    // 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 << "received message: " << msg->str << std::endl;
                std::cout << "> " << std::flush;
            }
            else if (msg->type == ix::WebSocketMessageType::Open)
            {
                std::cout << "Connection established" << std::endl;
                std::cout << "> " << std::flush;
            }
            else if (msg->type == ix::WebSocketMessageType::Error)
            {
                // Maybe SSL is not configured properly
                std::cout << "Connection error: " << msg->errorInfo.reason << std::endl;
                std::cout << "> " << std::flush;
            }
        }
    );

    // 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");

    // Display a prompt
    std::cout << "> " << std::flush;

    std::string text;
    // Read text from the console and send messages in text mode.
    // Exit with Ctrl-D on Unix or Ctrl-Z on Windows.
    while (std::getline(std::cin, text))
    {
        webSocket.send(text);
        std::cout << "> " << std::flush;
    }

    return 0;
}

Interested? Go read the docs! 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.

IXWebSocket is actively being developed, check out the changelog to know what's cooking. If you are looking for a real time messaging service (the chat-like 'server' your websocket code will talk to) with many features such as history, backed by Redis, look at cobra.

IXWebSocket client code is autobahn compliant beginning with the 6.0.0 version. See the current test results. Some tests are still failing in the server code.

Starting with the 11.0.8 release, IXWebSocket should be fully C++11 compatible.

Users

If your company or project is using this library, feel free to open an issue or PR to amend this list.

  • Machine Zone
  • Tokio, a discord library focused on audio playback with node bindings.
  • libDiscordBot, an easy to use Discord-bot framework.
  • gwebsocket, a websocket (lua) module for Garry's Mod
  • DisCPP, a simple but feature rich Discord API wrapper (archived as of Oct 8, 2021)
  • discord.cpp, a discord library for making bots
  • Teleport, Teleport is your own personal remote robot avatar
  • Abaddon, An alternative Discord client made with C++/gtkmm
  • NovaCoin, a hybrid scrypt PoW + PoS based cryptocurrency.
  • Candy, A WebSocket and TUN based VPN for Linux

Alternative libraries

There are plenty of great websocket libraries out there, which might work for you. Here are a couple of serious ones.

uvweb is a library written by the IXWebSocket author which is built on top of uvw, which is a C++ wrapper for libuv. It has more dependencies and does not support SSL at this point, but it can be used to open multiple connections within a single OS thread thanks to libuv.

To check the performance of a websocket library, you can look at the autoroute project.

Continuous Integration

OS TLS Sanitizer Status
Linux OpenSSL None Build2
macOS Secure Transport Thread Sanitizer Build2
macOS OpenSSL Thread Sanitizer Build2
macOS MbedTLS Thread Sanitizer Build2
Windows Disabled None Build2
UWP Disabled None Build2
Linux OpenSSL Address Sanitizer Build2
  • Some tests are disabled on Windows/UWP because of a pathing problem
  • TLS and ZLIB are disabled on Windows/UWP because enabling make the CI run takes a lot of time, for setting up vcpkg.

ixwebsocket's People

Contributors

ahausladen avatar arenevier avatar bsergean avatar cheney-w avatar crjc avatar cryptomaniac avatar dimon4eg avatar ebenali avatar fcojavmc avatar flagarde avatar itytophile avatar lanthora avatar liz3 avatar lunarwatcher avatar matt-deboer avatar mattparks avatar maxweisel avatar mox1 avatar natano avatar nexadn avatar ouwou avatar picanumber avatar rsmmr avatar seanomik avatar seizuresaladd avatar sethalves avatar theartfulbodger avatar thefrank avatar tostc avatar vol-alex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ixwebsocket's Issues

Not able to compile examples independently

Within makefile build option is available but looks like that's outdated since make build command won't work because there is no examples directory at root level so either those application files need to be moved to proper folder structure or makefile needs to be updated such that it works with current folder structure because most of those files moved under ws folder.

One of the sample error while using make build option.

(cd examples/satori_publisher ; mkdir -p build ; cd build ; cmake .. ; make)
/bin/sh: line 0: cd: examples/satori_publisher: No such file or directory

Interface of OnMessageCallback

Great library. Very useful. Very easy to use. Thank you for your hard work.

Having gotten into the weeds as a library user for the past 2 days, I would however suggest one major improvement from a user's perspective. If you'd like some help with this, I'd be happy to volunteer. Basically I'm happy to send you a pull request IF this is something you think you want in your library. If there is a reason you don't think this should happen, I'd love to know what it is before I start.

The callback function called when there is a message is passed a const reference to a string. I would suggest that there should also be an option to be called back with a pointer (possibly a standard library safe pointer) to a null terminated char* instead and possibly even a view to the relevant part of _rxbuf.

The reason is that in many cases what's being passed around in messages sent over websockets is JSON. If JSON (this also applies to various other text based message formats) is what is being passed it turns out that you can either allocate a bunch of memory to parse it or parse it in situ, ie by modifying the character buffer passed to the parser to create various tokens. The in situ methods are much faster, they avoid the allocation overhead, avoid most of the copying, and are guaranteed to be safe because they never go past the null pointer at the end, though they may add one or more in the middle which could cause strlen problems. By creating the relevant tokens in place you ALWAYS end up using less space than the length of the original JSON string.

It turns out that the library currently copies the relevant data into a string, and then passes a const reference to that. When the callback function returns the string is discarded, so there is no real reason for it to be const or for it to be a std::string which by convention makes the underlying char pointer opaque. Based on my examination of the code I've actually started const casting what I get from the string's c_str method and using that for in situ parsing and it all works. For a high volume of small messages this halved the cpu usage and memory usage of my initial implementation which copied the string into a char buffer before parsing in situ.

You are essentially telling the library user who doesn't get into the library implementation that they can't use the memory allocated to hold the data. This is sub-optimal because you are allocating memory to have something to pass and then immediately throwing it away so what happens to it doesn't really matter. If you do in fact start returning char buffers, I would suggest that this the buffer should be null terminated. The null makes JSON (and other text formats) parsing (potentially much) faster because you don't have to check your index against the length after each character. I would also suggest providing a length (as you already do) for parsing formats where that is better since you already have the length.

Even better would be if you simply provided a view into the appropriate portion of the (already unmasked) _rxbuf directly. Even if the callee modified this part of _rxbuf it doesn't really make a difference because once the callback returns you discard this portion of _rxbuf anyway. A good JSON in situ parser is not going to modify anything beyond the end of the part of the _rxbuf passed to it. And it would save the allocations and copying necessary to create the string that you are passing now and is potentially a huge performance win for a user of the library, essentially as large as the win from my using the c_str pointer from the string. Even after doing that, a program I wrote that user your library to receive a high volume of small JSON messages, parse them into a binary format, do light processing and then pass on the much smaller binary data onto multiple destinations spends a large percentage of it's time copying the relevant sections of the _rxbuf into a std::string before calling the callback.

The conan recipe is horribly outdated

The reason I'm opening this issue here is because the link to the conan recipe is in the readme. The recipe has several issues that, judging by recent commits as well, appear to be by design, or as a result of not being officially updated

I've been wanting to try out this library, but because of incompatible build systems, I have to use Conan.

I couldn't find IXWebSocket in any conan repository - only a recipe. So I went ahead and cloned it, and ran the command I'll be using for all these: conan create . IXWebSocket/stable. Output on the first go:

ERROR: Failed requirement 'OpenSSL/1.1.1b@zinnion/stable' from 'IXWebSocket/1.5.7@IXWebSocket/stable'
ERROR: Unable to find 'OpenSSL/1.1.1b@zinnion/stable' in remotes

I took a look at the dependencies, and they appear to be practically identical to the ones found in the official conan repo. So I replaced the dependencies with the same versions from conan/stable. Before that, I noticed the conan recipe is actually using a fork off this repo that's over 500 commits behind, and it's running 1.5.7, which is non-existent for this repo.

Anyway, re-run, fails:

[ 50%] Building CXX object CMakeFiles/test_package.dir/test_package.cpp.o
/usr/bin/clang++  -D_GLIBCXX_USE_CXX11_ABI=1 -I/root/.conan/data/IXWebSocket/1.5.7/IXWebSocket/stable/package/2d89e03e00941cc4186fea9b793094a560d9fb7b/include -I/root/.conan/data/OpenSSL/1.1.1b/conan/stable/package/e93595837cd71d31cd792a7899549d9f13bcd0cc/include -I/root/.conan/data/zlib/1.2.11/conan/stable/package/6d87124bcf4cc4435e13c44634d61b77404bef31/include  -m64 -stdlib=libstdc++ -O3 -DNDEBUG    -std=gnu++1z -o CMakeFiles/test_package.dir/test_package.cpp.o -c /programming/conanOrig/test_package/test_package.cpp
[100%] Linking CXX executable bin/test_package
/usr/bin/cmake -E cmake_link_script CMakeFiles/test_package.dir/link.txt --verbose=1
/usr/bin/clang++    -m64 -stdlib=libstdc++ -O3 -DNDEBUG        -rdynamic CMakeFiles/test_package.dir/test_package.cpp.o  -o bin/test_package  -L/root/.conan/data/IXWebSocket/1.5.7/IXWebSocket/stable/package/2d89e03e00941cc4186fea9b793094a560d9fb7b/lib  -L/root/.conan/data/OpenSSL/1.1.1b/conan/stable/package/e93595837cd71d31cd792a7899549d9f13bcd0cc/lib  -L/root/.conan/data/zlib/1.2.11/conan/stable/package/6d87124bcf4cc4435e13c44634d61b77404bef31/lib -Wl,-rpath,/root/.conan/data/IXWebSocket/1.5.7/IXWebSocket/stable/package/2d89e03e00941cc4186fea9b793094a560d9fb7b/lib:/root/.conan/data/OpenSSL/1.1.1b/conan/stable/package/e93595837cd71d31cd792a7899549d9f13bcd0cc/lib:/root/.conan/data/zlib/1.2.11/conan/stable/package/6d87124bcf4cc4435e13c44634d61b77404bef31/lib -lixwebsocket -lssl -lcrypto -ldl -lpthread -lz
/root/.conan/data/IXWebSocket/1.5.7/IXWebSocket/stable/package/2d89e03e00941cc4186fea9b793094a560d9fb7b/lib/libixwebsocket.a(IXSocketFactory.cpp.o): In function `ix::createSocket(bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)':
IXSocketFactory.cpp:(.text+0x52): undefined reference to `ix::SocketOpenSSL::SocketOpenSSL(int)'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
CMakeFiles/test_package.dir/build.make:97: recipe for target 'bin/test_package' failed
make[2]: *** [bin/test_package] Error 1
make[2]: Leaving directory '/programming/conanOrig/test_package/build/47edf16f7c6208a569a5a85106a6734e405b9db6'
CMakeFiles/Makefile2:70: recipe for target 'CMakeFiles/test_package.dir/all' failed
make[1]: *** [CMakeFiles/test_package.dir/all] Error 2
make[1]: Leaving directory '/programming/conanOrig/test_package/build/47edf16f7c6208a569a5a85106a6734e405b9db6'
Makefile:86: recipe for target 'all' failed
make: *** [all] Error 2
ERROR: IXWebSocket/1.5.7@IXWebSocket/stable (test package): Error in build() method, line 15
        cmake.build()
        ConanException: Error 512 while executing cmake --build '/programming/conanOrig/test_package/build/47edf16f7c6208a569a5a85106a6734e405b9db6' '--' '-j1'

When I was setting this up, I didn't notice the version. So I replaced the homepage URL without replacing the version, which resulted in another exception when it tried to get the archive, because 1.5.7 doesn't exist in this repo. I bumped the version as well, re-build, and:

[ 50%] Building CXX object CMakeFiles/test_package.dir/test_package.cpp.o
/usr/bin/clang++  -D_GLIBCXX_USE_CXX11_ABI=1 -I/root/.conan/data/IXWebSocket/5.0.0/IXWebSockets/stable/package/2d89e03e00941cc4186fea9b793094a560d9fb7b/include -I/root/.conan/data/OpenSSL/1.1.1b/conan/stable/package/e93595837cd71d31cd792a7899549d9f13bcd0cc/include -I/root/.conan/data/zlib/1.2.11/conan/stable/package/6d87124bcf4cc4435e13c44634d61b77404bef31/include  -m64 -stdlib=libstdc++ -O3 -DNDEBUG    -std=gnu++1z -o CMakeFiles/test_package.dir/test_package.cpp.o -c /programming/conan-IXWebSocket/test_package/test_package.cpp
/programming/conan-IXWebSocket/test_package/test_package.cpp:23:30: error: no member named 'WebSocket_MessageType_Message' in namespace 'ix'
      if (messageType == ix::WebSocket_MessageType_Message) {
                         ~~~~^
/programming/conan-IXWebSocket/test_package/test_package.cpp:24:14: error: no member named 'cout' in namespace 'std'
        std::cout << str << std::endl;
        ~~~~~^
/programming/conan-IXWebSocket/test_package/test_package.cpp:24:34: error: no member named 'endl' in namespace 'std'
        std::cout << str << std::endl;
                            ~~~~~^
/programming/conan-IXWebSocket/test_package/test_package.cpp:17:5: error: no viable conversion from '(lambda at /programming/conan-IXWebSocket/test_package/test_package.cpp:17:5)' to 'const ix::OnMessageCallback'
      (aka 'const function<void (const shared_ptr<ix::WebSocketMessage> &)>')
    [](ix::WebSocketMessageType messageType,
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/bits/std_function.h:421:7: note: candidate constructor not viable: no known conversion from '(lambda at /programming/conan-IXWebSocket/test_package/test_package.cpp:17:5)' to
      'std::nullptr_t' (aka 'nullptr_t') for 1st argument
      function(nullptr_t) noexcept
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/bits/std_function.h:432:7: note: candidate constructor not viable: no known conversion from '(lambda at /programming/conan-IXWebSocket/test_package/test_package.cpp:17:5)' to
      'const std::function<void (const std::shared_ptr<ix::WebSocketMessage> &)> &' for 1st argument
      function(const function& __x);
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/bits/std_function.h:441:7: note: candidate constructor not viable: no known conversion from '(lambda at /programming/conan-IXWebSocket/test_package/test_package.cpp:17:5)' to
      'std::function<void (const std::shared_ptr<ix::WebSocketMessage> &)> &&' for 1st argument
      function(function&& __x) noexcept : _Function_base()
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/bits/std_function.h:465:2: note: candidate template ignored: substitution failure
      [with _Functor = (lambda at /programming/conan-IXWebSocket/test_package/test_package.cpp:17:5), $1 = void]: no type named 'type' in 'std::result_of<(lambda at /programming/conan-IXWebSocket/test_package/test_package.cpp:17:5) &(const
      std::shared_ptr<ix::WebSocketMessage> &)>'
        function(_Functor);
        ^
/programming/conan-IXWebSocket/test_package/test_package.cpp:17:5: note: candidate function
    [](ix::WebSocketMessageType messageType,
    ^
/root/.conan/data/IXWebSocket/5.0.0/IXWebSockets/stable/package/2d89e03e00941cc4186fea9b793094a560d9fb7b/include/ixwebsocket/IXWebSocket.h:80:60: note: passing argument to parameter 'callback' here
        void setOnMessageCallback(const OnMessageCallback& callback);
                                                           ^
4 errors generated.
CMakeFiles/test_package.dir/build.make:65: recipe for target 'CMakeFiles/test_package.dir/test_package.cpp.o' failed
make[2]: *** [CMakeFiles/test_package.dir/test_package.cpp.o] Error 1
make[2]: Leaving directory '/programming/conan-IXWebSocket/test_package/build/47edf16f7c6208a569a5a85106a6734e405b9db6'
CMakeFiles/Makefile2:70: recipe for target 'CMakeFiles/test_package.dir/all' failed
make[1]: *** [CMakeFiles/test_package.dir/all] Error 2
make[1]: Leaving directory '/programming/conan-IXWebSocket/test_package/build/47edf16f7c6208a569a5a85106a6734e405b9db6'
Makefile:86: recipe for target 'all' failed
make: *** [all] Error 2
ERROR: IXWebSocket/5.0.0@IXWebSockets/stable (test package): Error in build() method, line 15
        cmake.build()
        ConanException: Error 512 while executing cmake --build '/programming/conan-IXWebSocket/test_package/build/47edf16f7c6208a569a5a85106a6734e405b9db6' '--' '-j1'

I also actually can't find some of these fields in the fork. The new variant (WebSocketMessageType, as outlined in the readme of this project) at least exists in this repo. The file in question also only exists here - I can't find either of these in the repo the recipe points to.

Also, off the top of my head, this will probably fail (if that's an actual concept - I'm not that familiar with developing Conan recipes myself), because not everyone happens to have a websocket server at localhost:8080 running.

So for the hell of it, I used my fixed package to test. I used the example using localhost:8080 on the main site, with the imports:

#include <iostream>
#include <ixwebsocket/IXWebSocket.h>
#include <ixwebsocket/IXSocket.h>
#include <ixwebsocket/IXWebSocketMessageType.h>

as well as the conan package I built and a basic CMakeLists.txt I pretty much borrowed from the Conan docs. It compiled with no errors.

But to get there, I had to change the repo, bump the version, and remove the tests (while updating the test could've worked as well, I'm not familiar with the library, or creating conan recipes, so I didn't want to push my luck).

Could the conan recipe be updated? Pushing it to conan-center as well could be a good idea.

Windows unittest does not pass (IXSocketTest)

I tried to fix that myself quite a bit but I don't have a windows box so it's a bit hard to fix. I've used appveyor to make sure that all the code builds and run on Windows though.

IXWebsocket with jetty + Tomcat websocket's server

Dear @bsergean ,
I'm really thankful for your great project and your helpful role to respond your IXWebsocket's followers.
IXWebsocket works with its own websocket's server correctly.I decided to test it with another websocket's server (Tomcat,Jetty, ......).
I couldn't open and send text or binary message and the getReadyState() is onClosing.
my question is : are other websocket's server supported by the IXWebsocket?

Using IXWebSocket on Raspberry

Hi dear @bsergean ,
Thanks for your great and light project to use Websocket technology.
I have a simple and maybe clear question.
is it possible to use IXWebSocket on Arm board family specially Raspbian OS?

Changing query string parameter

Hi @bsergean

is it possible to change query string parameter after socket connection is established without closing and opening it again?
for example?

ix::WebSocket webSocket;
		webSocket.setOnMessageCallback(
		    [](ix::WebSocketMessageType messageType,
		       const std::string& str,
		       size_t wireSize,
		       const ix::WebSocketErrorInfo& error,
		       const ix::WebSocketOpenInfo& openInfo,
		       const ix::WebSocketCloseInfo& closeInfo)
			   {
		        if (messageType == ix::WebSocketMessageType::Message)
		        {
		            std::cout << str << std::endl;
		        }
			   });
              url="http://mysocketaddress?param=1"
		webSocket.setUrl(url);
                webSocket.start();
		webSocket.send(str)
                url="http://mysocketaddress?param=2"
               webSocket.setUrl(url);
              webSocket.send(str)

WebSocketTransport::close method does not make sense

We have 3 states, OPEN, CLOSED, CLOSING.

        // We start by doing an early out if we are not OPENED essentially
        if (_readyState == ReadyState::CLOSING || _readyState == ReadyState::CLOSED) return;


        // connection is opened, so close without sending close frame
        if (_readyState == ReadyState::OPEN)
        {
            {
                std::lock_guard<std::mutex> lock(_closeDataMutex);
                _closeCode = code;
                _closeReason = reason;
                _closeWireSize = closeWireSize;
                _closeRemote = remote;
            }
            {
                std::lock_guard<std::mutex> lock(_closingTimePointMutex);
                _closingTimePoint = std::chrono::steady_clock::now();
            }
            setReadyState(ReadyState::CLOSING);

            sendCloseFrame(code, reason);
            // wake up the poll, but do not close yet
            _socket->wakeUpFromPoll(Socket::kSendRequest);
        }

        // Why would we ever come back here ? If that function is called twice ?
        else
        {

Support Text messages (on top of binary)

I just re-read what the RFC says about TEXT, and it requires that the messages are utf-8 encoded. I guess I could just validate that text messages are valid utf-8 and fail otherwise, and same deal on the receiving end. Maybe we should support TEXT.

Connect error descriptions are invalid

Connecting to url: ws://127.0.0.1
> Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connect error: Operation now in progress
#retries: 1
Wait time(ms): 100
HTTP Status: 0

instead it should say:

Connecting to url: ws://127.0.0.1
> Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connection refused
#retries: 1
Wait time(ms): 100
HTTP Status: 0

git bisect says that this is the bad commit: 705625a

Full git bisect log (what an amazing tool ...)

(venv) IXWebSocket$ git bisect start 
(venv) IXWebSocket$ git bisect bad   
(venv) IXWebSocket$ git bisect good 0e59927384cbd3fa3d54d2f941271635e5c3876c
Bisecting: 62 revisions left to test after this (roughly 6 steps)
[6177fe7803fe526867bbc338f354aeccefb2a08f] add notes about mbedtls CMake
(venv) IXWebSocket$ 
(venv) IXWebSocket$ 
(venv) IXWebSocket$ 
(venv) IXWebSocket$ make
mkdir -p build && (cd build ; cmake -DUSE_TLS=1 -DUSE_WS=1 -DUSE_MBED_TLS=1 .. ; make -j install)
-- Found PythonInterp: /Users/bsergeant/src/foss/cobra/venv/bin/python (found version "3.7.2") 
-- Found Perl: /opt/local/bin/perl (found version "5.16.3") 
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/bsergeant/src/foss/IXWebSocket/build
Scanning dependencies of target mbedcrypto
[  2%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/arc4.c.o
[  2%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/aesni.c.o
[  3%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/aria.c.o
[  3%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/aes.c.o
[  3%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/asn1parse.c.o
[  4%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/asn1write.c.o
[  5%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/base64.c.o
[  5%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/bignum.c.o
[  6%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/blowfish.c.o
[  7%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/ccm.c.o
[  7%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/camellia.c.o
[  8%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/chacha20.c.o
[  9%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/chachapoly.c.o
[  9%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/cipher.c.o
[ 10%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/cipher_wrap.c.o
[ 11%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/cmac.c.o
[ 11%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/ctr_drbg.c.o
[ 12%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/des.c.o
[ 13%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/dhm.c.o
[ 13%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/ecdh.c.o
[ 14%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/ecdsa.c.o
[ 15%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/ecjpake.c.o
[ 15%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/ecp_curves.c.o
[ 16%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/ecp.c.o
[ 17%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/entropy_poll.c.o
[ 18%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/entropy.c.o
[ 19%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/havege.c.o
[ 19%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/gcm.c.o
[ 20%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/hkdf.c.o
[ 20%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/hmac_drbg.c.o
[ 21%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/md.c.o
[ 22%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/md2.c.o
[ 22%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/md4.c.o
[ 23%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/md_wrap.c.o
[ 24%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/md5.c.o
[ 24%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/memory_buffer_alloc.c.o
[ 25%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/oid.c.o
[ 26%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/nist_kw.c.o
[ 26%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/padlock.c.o
[ 27%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/pem.c.o
[ 28%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/pk.c.o
[ 29%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/pkcs12.c.o
[ 30%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/pkparse.c.o
[ 30%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/pkcs5.c.o
[ 31%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/pkwrite.c.o
[ 32%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/platform.c.o
[ 32%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/psa_crypto_storage.c.o
[ 33%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/psa_crypto.c.o
[ 34%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/psa_its_file.c.o
[ 35%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/psa_crypto_slot_management.c.o
[ 35%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/pk_wrap.c.o
[ 36%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/poly1305.c.o
[ 36%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/platform_util.c.o
[ 37%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/rsa_internal.c.o
[ 38%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/ripemd160.c.o
[ 38%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/rsa.c.o
[ 39%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/__/__/library/version.c.o
[ 39%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/sha256.c.o
[ 39%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/__/__/library/version_features.c.o
[ 41%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/sha1.c.o
[ 41%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/sha512.c.o
[ 43%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/__/__/library/error.c.o
[ 43%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/threading.c.o
[ 43%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/timing.c.o
[ 44%] Building C object third_party/mbedtls/crypto/library/CMakeFiles/mbedcrypto.dir/xtea.c.o
[ 45%] Linking C static library libmbedcrypto.a
[ 45%] Built target mbedcrypto
Scanning dependencies of target mbedx509
[ 46%] Building C object third_party/mbedtls/library/CMakeFiles/mbedx509.dir/x509.c.o
[ 46%] Building C object third_party/mbedtls/library/CMakeFiles/mbedx509.dir/certs.c.o
[ 46%] Building C object third_party/mbedtls/library/CMakeFiles/mbedx509.dir/x509_create.c.o
[ 47%] Building C object third_party/mbedtls/library/CMakeFiles/mbedx509.dir/pkcs11.c.o
[ 48%] Building C object third_party/mbedtls/library/CMakeFiles/mbedx509.dir/x509_crl.c.o
[ 49%] Building C object third_party/mbedtls/library/CMakeFiles/mbedx509.dir/x509_crt.c.o
[ 49%] Building C object third_party/mbedtls/library/CMakeFiles/mbedx509.dir/x509_csr.c.o
[ 51%] Building C object third_party/mbedtls/library/CMakeFiles/mbedx509.dir/x509write_crt.c.o
[ 51%] Building C object third_party/mbedtls/library/CMakeFiles/mbedx509.dir/x509write_csr.c.o
[ 51%] Linking C static library libmbedx509.a
[ 51%] Built target mbedx509
Scanning dependencies of target mbedtls
[ 51%] Building C object third_party/mbedtls/library/CMakeFiles/mbedtls.dir/debug.c.o
[ 51%] Building C object third_party/mbedtls/library/CMakeFiles/mbedtls.dir/ssl_ciphersuites.c.o
[ 52%] Building C object third_party/mbedtls/library/CMakeFiles/mbedtls.dir/ssl_cache.c.o
[ 53%] Building C object third_party/mbedtls/library/CMakeFiles/mbedtls.dir/net_sockets.c.o
[ 54%] Building C object third_party/mbedtls/library/CMakeFiles/mbedtls.dir/ssl_cli.c.o
[ 55%] Building C object third_party/mbedtls/library/CMakeFiles/mbedtls.dir/ssl_cookie.c.o
[ 56%] Building C object third_party/mbedtls/library/CMakeFiles/mbedtls.dir/ssl_srv.c.o
[ 57%] Building C object third_party/mbedtls/library/CMakeFiles/mbedtls.dir/ssl_tls.c.o
[ 57%] Building C object third_party/mbedtls/library/CMakeFiles/mbedtls.dir/ssl_ticket.c.o
[ 58%] Linking C static library libmbedtls.a
[ 58%] Built target mbedtls
Scanning dependencies of target ixwebsocket
[ 59%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSocketServer.cpp.o
[ 59%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSocket.cpp.o
[ 60%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSocketConnect.cpp.o
[ 61%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXDNSLookup.cpp.o
[ 62%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXCancellationRequest.cpp.o
[ 62%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSocketFactory.cpp.o
[ 62%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXNetSystem.cpp.o
[ 63%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocket.cpp.o
[ 63%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketTransport.cpp.o
[ 64%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketServer.cpp.o
[ 65%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketHandshake.cpp.o
[ 66%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketPerMessageDeflate.cpp.o
[ 66%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketPerMessageDeflateCodec.cpp.o
[ 67%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketPerMessageDeflateOptions.cpp.o
[ 69%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXHttpClient.cpp.o
[ 69%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSelectInterrupt.cpp.o
[ 70%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketMessageQueue.cpp.o
[ 70%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/LUrlParser.cpp.o
[ 69%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXUrlParser.cpp.o
[ 71%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSelectInterruptPipe.cpp.o
[ 73%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSocketMbedTLS.cpp.o
[ 73%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXConnectionState.cpp.o
[ 73%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/apple/IXSetThreadName_apple.cpp.o
[ 74%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketHttpHeaders.cpp.o
[ 75%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSelectInterruptFactory.cpp.o
[ 75%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketCloseConstants.cpp.o
[ 76%] Linking CXX static library libixwebsocket.a
[ 76%] Built target ixwebsocket
Scanning dependencies of target ws
[ 78%] Building CXX object ws/CMakeFiles/ws.dir/__/third_party/jsoncpp/jsoncpp.cpp.o
[ 78%] Building CXX object ws/CMakeFiles/ws.dir/__/third_party/msgpack11/msgpack11.cpp.o
[ 79%] Building CXX object ws/CMakeFiles/ws.dir/ixcrypto/IXHash.cpp.o
[ 79%] Building CXX object ws/CMakeFiles/ws.dir/ixcore/utils/IXCoreLogger.cpp.o
[ 80%] Building CXX object ws/CMakeFiles/ws.dir/ixcrypto/IXUuid.cpp.o
[ 80%] Building CXX object ws/CMakeFiles/ws.dir/__/third_party/statsd-client-cpp/src/statsd_client.cpp.o
[ 81%] Building CXX object ws/CMakeFiles/ws.dir/ixcrypto/IXBase64.cpp.o
[ 82%] Building CXX object ws/CMakeFiles/ws.dir/ixcrypto/IXHMac.cpp.o
[ 83%] Building CXX object ws/CMakeFiles/ws.dir/ixcobra/IXCobraMetricsPublisher.cpp.o
[ 83%] Building CXX object ws/CMakeFiles/ws.dir/ixcobra/IXCobraConnection.cpp.o
[ 84%] Building CXX object ws/CMakeFiles/ws.dir/ixcobra/IXCobraMetricsThreadedPublisher.cpp.o
[ 85%] Building CXX object ws/CMakeFiles/ws.dir/snake/IXSnakeServer.cpp.o
[ 86%] Building CXX object ws/CMakeFiles/ws.dir/snake/IXAppConfig.cpp.o
[ 86%] Building CXX object ws/CMakeFiles/ws.dir/IXSentryClient.cpp.o
[ 87%] Building CXX object ws/CMakeFiles/ws.dir/IXRedisClient.cpp.o
[ 88%] Building CXX object ws/CMakeFiles/ws.dir/ws_http_client.cpp.o
[ 89%] Building CXX object ws/CMakeFiles/ws.dir/ws_ping_pong.cpp.o
[ 89%] Building CXX object ws/CMakeFiles/ws.dir/ws_broadcast_server.cpp.o
[ 90%] Building CXX object ws/CMakeFiles/ws.dir/ws_chat.cpp.o
[ 90%] Building CXX object ws/CMakeFiles/ws.dir/ws_connect.cpp.o
[ 90%] Building CXX object ws/CMakeFiles/ws.dir/ws_receive.cpp.o
[ 91%] Building CXX object ws/CMakeFiles/ws.dir/ws_redis_publish.cpp.o
[ 91%] Building CXX object ws/CMakeFiles/ws.dir/snake/IXSnakeProtocol.cpp.o
[ 92%] Building CXX object ws/CMakeFiles/ws.dir/ws_cobra_publish.cpp.o
[ 93%] Building CXX object ws/CMakeFiles/ws.dir/ws_echo_server.cpp.o
[ 94%] Building CXX object ws/CMakeFiles/ws.dir/ws_send.cpp.o
[ 94%] Building CXX object ws/CMakeFiles/ws.dir/ws_cobra_subscribe.cpp.o
[ 95%] Building CXX object ws/CMakeFiles/ws.dir/ws_transfer.cpp.o
[ 96%] Building CXX object ws/CMakeFiles/ws.dir/ws_redis_subscribe.cpp.o
[ 96%] Building CXX object ws/CMakeFiles/ws.dir/ws_cobra_to_sentry.cpp.o
[ 97%] Building CXX object ws/CMakeFiles/ws.dir/ws_cobra_to_statsd.cpp.o
[ 98%] Building CXX object ws/CMakeFiles/ws.dir/ws_snake.cpp.o
[ 99%] Building CXX object ws/CMakeFiles/ws.dir/ws.cpp.o
In file included from /Users/bsergeant/src/foss/IXWebSocket/ws/ws.cpp:22:
In file included from /Users/bsergeant/src/foss/IXWebSocket/ws/../third_party/cli11/CLI11.hpp:152:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/experimental/optional:163:4: warning: 
      "<experimental/optional> is deprecated and will be removed in the next release. Please use C++17's
      <optional> instead." [-W#warnings]
#  warning "<experimental/optional> is deprecated and will be removed in the next release. Please us...
   ^
1 warning generated.
[100%] Linking CXX executable ws
[100%] Built target ws
Install the project...
-- Install configuration: "Debug"
-- Installing: /usr/local/lib/libixwebsocket.a
-- Installing: /usr/local/include/ixwebsocket/IXSocket.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSocketServer.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSocketConnect.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSocketFactory.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSetThreadName.h
-- Installing: /usr/local/include/ixwebsocket/IXDNSLookup.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXCancellationRequest.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXNetSystem.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXProgressCallback.h
-- Installing: /usr/local/include/ixwebsocket/IXWebSocket.h
-- Installing: /usr/local/include/ixwebsocket/IXWebSocketServer.h
-- Installing: /usr/local/include/ixwebsocket/IXWebSocketTransport.h
-- Installing: /usr/local/include/ixwebsocket/IXWebSocketHandshake.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketSendInfo.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketErrorInfo.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketPerMessageDeflate.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketPerMessageDeflateCodec.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketPerMessageDeflateOptions.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketHttpHeaders.h
-- Up-to-date: /usr/local/include/ixwebsocket/libwshandshake.hpp
-- Installing: /usr/local/include/ixwebsocket/IXHttpClient.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXUrlParser.h
-- Up-to-date: /usr/local/include/ixwebsocket/LUrlParser.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSelectInterrupt.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSelectInterruptFactory.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXConnectionState.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketCloseConstants.h
-- Installing: /usr/local/include/ixwebsocket/IXWebSocketMessageQueue.h
-- Installing: /usr/local/include/ixwebsocket/IXSocketMbedTLS.h
-- Installing: /usr/local/lib/libmbedtls.a
-- Installing: /usr/local/lib/libmbedx509.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /usr/local/lib/libmbedx509.a(pkcs11.c.o) has no symbols
-- Installing: /usr/local/include/mbedtls/aes.h
-- Installing: /usr/local/include/mbedtls/aesni.h
-- Installing: /usr/local/include/mbedtls/arc4.h
-- Installing: /usr/local/include/mbedtls/aria.h
-- Installing: /usr/local/include/mbedtls/asn1.h
-- Installing: /usr/local/include/mbedtls/asn1write.h
-- Installing: /usr/local/include/mbedtls/base64.h
-- Installing: /usr/local/include/mbedtls/bignum.h
-- Installing: /usr/local/include/mbedtls/blowfish.h
-- Installing: /usr/local/include/mbedtls/bn_mul.h
-- Installing: /usr/local/include/mbedtls/camellia.h
-- Installing: /usr/local/include/mbedtls/ccm.h
-- Installing: /usr/local/include/mbedtls/certs.h
-- Installing: /usr/local/include/mbedtls/chacha20.h
-- Installing: /usr/local/include/mbedtls/chachapoly.h
-- Installing: /usr/local/include/mbedtls/check_config.h
-- Installing: /usr/local/include/mbedtls/cipher.h
-- Installing: /usr/local/include/mbedtls/cipher_internal.h
-- Installing: /usr/local/include/mbedtls/cmac.h
-- Installing: /usr/local/include/mbedtls/compat-1.3.h
-- Installing: /usr/local/include/mbedtls/config.h
-- Installing: /usr/local/include/mbedtls/ctr_drbg.h
-- Installing: /usr/local/include/mbedtls/debug.h
-- Installing: /usr/local/include/mbedtls/des.h
-- Installing: /usr/local/include/mbedtls/dhm.h
-- Installing: /usr/local/include/mbedtls/ecdh.h
-- Installing: /usr/local/include/mbedtls/ecdsa.h
-- Installing: /usr/local/include/mbedtls/ecjpake.h
-- Installing: /usr/local/include/mbedtls/ecp.h
-- Installing: /usr/local/include/mbedtls/ecp_internal.h
-- Installing: /usr/local/include/mbedtls/entropy.h
-- Installing: /usr/local/include/mbedtls/entropy_poll.h
-- Installing: /usr/local/include/mbedtls/error.h
-- Installing: /usr/local/include/mbedtls/gcm.h
-- Installing: /usr/local/include/mbedtls/havege.h
-- Installing: /usr/local/include/mbedtls/hkdf.h
-- Installing: /usr/local/include/mbedtls/hmac_drbg.h
-- Installing: /usr/local/include/mbedtls/md.h
-- Installing: /usr/local/include/mbedtls/md2.h
-- Installing: /usr/local/include/mbedtls/md4.h
-- Installing: /usr/local/include/mbedtls/md5.h
-- Installing: /usr/local/include/mbedtls/md_internal.h
-- Installing: /usr/local/include/mbedtls/memory_buffer_alloc.h
-- Installing: /usr/local/include/mbedtls/net.h
-- Installing: /usr/local/include/mbedtls/net_sockets.h
-- Installing: /usr/local/include/mbedtls/nist_kw.h
-- Installing: /usr/local/include/mbedtls/oid.h
-- Installing: /usr/local/include/mbedtls/padlock.h
-- Installing: /usr/local/include/mbedtls/pem.h
-- Installing: /usr/local/include/mbedtls/pk.h
-- Installing: /usr/local/include/mbedtls/pk_internal.h
-- Installing: /usr/local/include/mbedtls/pkcs11.h
-- Installing: /usr/local/include/mbedtls/pkcs12.h
-- Installing: /usr/local/include/mbedtls/pkcs5.h
-- Installing: /usr/local/include/mbedtls/platform.h
-- Installing: /usr/local/include/mbedtls/platform_time.h
-- Installing: /usr/local/include/mbedtls/platform_util.h
-- Installing: /usr/local/include/mbedtls/poly1305.h
-- Installing: /usr/local/include/mbedtls/psa_util.h
-- Installing: /usr/local/include/mbedtls/ripemd160.h
-- Installing: /usr/local/include/mbedtls/rsa.h
-- Installing: /usr/local/include/mbedtls/rsa_internal.h
-- Installing: /usr/local/include/mbedtls/sha1.h
-- Installing: /usr/local/include/mbedtls/sha256.h
-- Installing: /usr/local/include/mbedtls/sha512.h
-- Installing: /usr/local/include/mbedtls/ssl.h
-- Installing: /usr/local/include/mbedtls/ssl_cache.h
-- Installing: /usr/local/include/mbedtls/ssl_ciphersuites.h
-- Installing: /usr/local/include/mbedtls/ssl_cookie.h
-- Installing: /usr/local/include/mbedtls/ssl_internal.h
-- Installing: /usr/local/include/mbedtls/ssl_ticket.h
-- Installing: /usr/local/include/mbedtls/threading.h
-- Installing: /usr/local/include/mbedtls/timing.h
-- Installing: /usr/local/include/mbedtls/version.h
-- Installing: /usr/local/include/mbedtls/x509.h
-- Installing: /usr/local/include/mbedtls/x509_crl.h
-- Installing: /usr/local/include/mbedtls/x509_crt.h
-- Installing: /usr/local/include/mbedtls/x509_csr.h
-- Installing: /usr/local/include/mbedtls/xtea.h
-- Installing: /usr/local/lib/libmbedcrypto.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /usr/local/lib/libmbedcrypto.a(aria.c.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /usr/local/lib/libmbedcrypto.a(cmac.c.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /usr/local/lib/libmbedcrypto.a(ecjpake.c.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /usr/local/lib/libmbedcrypto.a(havege.c.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /usr/local/lib/libmbedcrypto.a(md2.c.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /usr/local/lib/libmbedcrypto.a(md4.c.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /usr/local/lib/libmbedcrypto.a(memory_buffer_alloc.c.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /usr/local/lib/libmbedcrypto.a(nist_kw.c.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /usr/local/lib/libmbedcrypto.a(padlock.c.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /usr/local/lib/libmbedcrypto.a(psa_crypto_storage.c.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /usr/local/lib/libmbedcrypto.a(psa_its_file.c.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: /usr/local/lib/libmbedcrypto.a(threading.c.o) has no symbols
-- Up-to-date: /usr/local/include/mbedtls/aes.h
-- Up-to-date: /usr/local/include/mbedtls/aesni.h
-- Up-to-date: /usr/local/include/mbedtls/arc4.h
-- Up-to-date: /usr/local/include/mbedtls/aria.h
-- Up-to-date: /usr/local/include/mbedtls/asn1.h
-- Up-to-date: /usr/local/include/mbedtls/asn1write.h
-- Up-to-date: /usr/local/include/mbedtls/base64.h
-- Up-to-date: /usr/local/include/mbedtls/bignum.h
-- Up-to-date: /usr/local/include/mbedtls/blowfish.h
-- Up-to-date: /usr/local/include/mbedtls/bn_mul.h
-- Up-to-date: /usr/local/include/mbedtls/camellia.h
-- Up-to-date: /usr/local/include/mbedtls/ccm.h
-- Up-to-date: /usr/local/include/mbedtls/certs.h
-- Up-to-date: /usr/local/include/mbedtls/chacha20.h
-- Up-to-date: /usr/local/include/mbedtls/chachapoly.h
-- Up-to-date: /usr/local/include/mbedtls/check_config.h
-- Up-to-date: /usr/local/include/mbedtls/cipher.h
-- Up-to-date: /usr/local/include/mbedtls/cipher_internal.h
-- Up-to-date: /usr/local/include/mbedtls/cmac.h
-- Up-to-date: /usr/local/include/mbedtls/compat-1.3.h
-- Up-to-date: /usr/local/include/mbedtls/config.h
-- Up-to-date: /usr/local/include/mbedtls/ctr_drbg.h
-- Up-to-date: /usr/local/include/mbedtls/des.h
-- Up-to-date: /usr/local/include/mbedtls/dhm.h
-- Up-to-date: /usr/local/include/mbedtls/ecdh.h
-- Up-to-date: /usr/local/include/mbedtls/ecdsa.h
-- Up-to-date: /usr/local/include/mbedtls/ecjpake.h
-- Up-to-date: /usr/local/include/mbedtls/ecp.h
-- Up-to-date: /usr/local/include/mbedtls/ecp_internal.h
-- Up-to-date: /usr/local/include/mbedtls/entropy.h
-- Up-to-date: /usr/local/include/mbedtls/entropy_poll.h
-- Up-to-date: /usr/local/include/mbedtls/error.h
-- Up-to-date: /usr/local/include/mbedtls/gcm.h
-- Up-to-date: /usr/local/include/mbedtls/havege.h
-- Up-to-date: /usr/local/include/mbedtls/hkdf.h
-- Up-to-date: /usr/local/include/mbedtls/hmac_drbg.h
-- Up-to-date: /usr/local/include/mbedtls/md.h
-- Up-to-date: /usr/local/include/mbedtls/md2.h
-- Up-to-date: /usr/local/include/mbedtls/md4.h
-- Up-to-date: /usr/local/include/mbedtls/md5.h
-- Up-to-date: /usr/local/include/mbedtls/md_internal.h
-- Up-to-date: /usr/local/include/mbedtls/memory_buffer_alloc.h
-- Up-to-date: /usr/local/include/mbedtls/nist_kw.h
-- Up-to-date: /usr/local/include/mbedtls/oid.h
-- Up-to-date: /usr/local/include/mbedtls/padlock.h
-- Up-to-date: /usr/local/include/mbedtls/pem.h
-- Up-to-date: /usr/local/include/mbedtls/pk.h
-- Up-to-date: /usr/local/include/mbedtls/pk_internal.h
-- Up-to-date: /usr/local/include/mbedtls/pkcs12.h
-- Up-to-date: /usr/local/include/mbedtls/pkcs5.h
-- Up-to-date: /usr/local/include/mbedtls/platform.h
-- Up-to-date: /usr/local/include/mbedtls/platform_time.h
-- Up-to-date: /usr/local/include/mbedtls/platform_util.h
-- Up-to-date: /usr/local/include/mbedtls/poly1305.h
-- Up-to-date: /usr/local/include/mbedtls/psa_util.h
-- Up-to-date: /usr/local/include/mbedtls/ripemd160.h
-- Up-to-date: /usr/local/include/mbedtls/rsa.h
-- Up-to-date: /usr/local/include/mbedtls/rsa_internal.h
-- Up-to-date: /usr/local/include/mbedtls/sha1.h
-- Up-to-date: /usr/local/include/mbedtls/sha256.h
-- Up-to-date: /usr/local/include/mbedtls/sha512.h
-- Up-to-date: /usr/local/include/mbedtls/threading.h
-- Up-to-date: /usr/local/include/mbedtls/timing.h
-- Up-to-date: /usr/local/include/mbedtls/version.h
-- Up-to-date: /usr/local/include/mbedtls/xtea.h
-- Installing: /usr/local/include/psa/crypto.h
-- Installing: /usr/local/include/psa/crypto_accel_driver.h
-- Installing: /usr/local/include/psa/crypto_driver_common.h
-- Installing: /usr/local/include/psa/crypto_entropy_driver.h
-- Installing: /usr/local/include/psa/crypto_extra.h
-- Installing: /usr/local/include/psa/crypto_platform.h
-- Installing: /usr/local/include/psa/crypto_se_driver.h
-- Installing: /usr/local/include/psa/crypto_sizes.h
-- Installing: /usr/local/include/psa/crypto_struct.h
-- Installing: /usr/local/include/psa/crypto_types.h
-- Installing: /usr/local/include/psa/crypto_values.h
-- Installing: /usr/local/bin/ws
(venv) IXWebSocket$ cd ws connect ws://127.0.0.1                       
cd: too many arguments
(venv) IXWebSocket$ ws connect ws://127.0.0.1  
Type Ctrl-D to exit prompt...
Connecting to url: ws://127.0.0.1
> Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connection refused
#retries: 1
Wait time(ms): 100
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connection refused
#retries: 2
Wait time(ms): 200
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connection refused
#retries: 3
Wait time(ms): 400
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connection refused
#retries: 4
Wait time(ms): 800
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connection refused
#retries: 5
Wait time(ms): 1600
HTTP Status: 0

^C
(venv) IXWebSocket$ 
(venv) IXWebSocket$ git bisect good                                         
Bisecting: 31 revisions left to test after this (roughly 5 steps)
[5f4a43084575bd0e7b4a172f0c5ad4314aca7a07] disable building ws on windows on travis
(venv) IXWebSocket$ 
(venv) IXWebSocket$ 
(venv) IXWebSocket$ 
(venv) IXWebSocket$ 
(venv) IXWebSocket$ make && ws connect ws://127.0.0.1
mkdir -p build && (cd build ; cmake -DUSE_TLS=1 -DUSE_WS=1 .. ; make -j install)
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/bsergeant/src/foss/IXWebSocket/build
Scanning dependencies of target ixwebsocket
[  1%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXConnectionState.cpp.o
[  3%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXDNSLookup.cpp.o
[  6%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXCancellationRequest.cpp.o
[  6%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXHttpClient.cpp.o
[  8%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXNetSystem.cpp.o
[  9%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSelectInterrupt.cpp.o
[ 11%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSelectInterruptFactory.cpp.o
[ 13%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSocketConnect.cpp.o
[ 16%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSocket.cpp.o
[ 16%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSocketFactory.cpp.o
[ 18%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXUrlParser.cpp.o
[ 19%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSocketServer.cpp.o
[ 21%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocket.cpp.o
[ 22%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketHttpHeaders.cpp.o
[ 24%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketHandshake.cpp.o
[ 26%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketMessageQueue.cpp.o
[ 27%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketPerMessageDeflate.cpp.o
[ 29%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketServer.cpp.o
[ 31%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/LUrlParser.cpp.o
[ 32%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketCloseConstants.cpp.o
[ 39%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSelectInterruptPipe.cpp.o
[ 40%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketPerMessageDeflateOptions.cpp.o
[ 42%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketTransport.cpp.o
[ 42%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketPerMessageDeflateCodec.cpp.o
[ 40%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/apple/IXSetThreadName_apple.cpp.o
[ 42%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSocketMbedTLS.cpp.o
[ 44%] Linking CXX static library libixwebsocket.a
[ 44%] Built target ixwebsocket
Scanning dependencies of target ws
[ 45%] Building CXX object ws/CMakeFiles/ws.dir/__/third_party/msgpack11/msgpack11.cpp.o
[ 47%] Building CXX object ws/CMakeFiles/ws.dir/ixcore/utils/IXCoreLogger.cpp.o
[ 49%] Building CXX object ws/CMakeFiles/ws.dir/__/third_party/jsoncpp/jsoncpp.cpp.o
[ 50%] Building CXX object ws/CMakeFiles/ws.dir/__/third_party/statsd-client-cpp/src/statsd_client.cpp.o
[ 54%] Building CXX object ws/CMakeFiles/ws.dir/ixcrypto/IXUuid.cpp.o
[ 55%] Building CXX object ws/CMakeFiles/ws.dir/ixcrypto/IXBase64.cpp.o
[ 55%] Building CXX object ws/CMakeFiles/ws.dir/ixcrypto/IXHash.cpp.o
[ 57%] Building CXX object ws/CMakeFiles/ws.dir/ixcrypto/IXHMac.cpp.o
[ 60%] Building CXX object ws/CMakeFiles/ws.dir/ixcobra/IXCobraConnection.cpp.o
[ 60%] Building CXX object ws/CMakeFiles/ws.dir/ixcobra/IXCobraMetricsPublisher.cpp.o
[ 62%] Building CXX object ws/CMakeFiles/ws.dir/ixcobra/IXCobraMetricsThreadedPublisher.cpp.o
[ 63%] Building CXX object ws/CMakeFiles/ws.dir/snake/IXSnakeServer.cpp.o
[ 65%] Building CXX object ws/CMakeFiles/ws.dir/snake/IXSnakeProtocol.cpp.o
[ 68%] Building CXX object ws/CMakeFiles/ws.dir/IXRedisClient.cpp.o
[ 68%] Building CXX object ws/CMakeFiles/ws.dir/snake/IXAppConfig.cpp.o
[ 70%] Building CXX object ws/CMakeFiles/ws.dir/ws_ping_pong.cpp.o
[ 72%] Building CXX object ws/CMakeFiles/ws.dir/ws_broadcast_server.cpp.o
[ 73%] Building CXX object ws/CMakeFiles/ws.dir/ws_transfer.cpp.o
[ 75%] Building CXX object ws/CMakeFiles/ws.dir/ws_cobra_subscribe.cpp.o
[ 77%] Building CXX object ws/CMakeFiles/ws.dir/ws_cobra_to_statsd.cpp.o
[ 78%] Building CXX object ws/CMakeFiles/ws.dir/ws.cpp.o
[ 80%] Building CXX object ws/CMakeFiles/ws.dir/ws_cobra_to_sentry.cpp.o
[ 81%] Building CXX object ws/CMakeFiles/ws.dir/ws_http_client.cpp.o
[ 83%] Building CXX object ws/CMakeFiles/ws.dir/IXSentryClient.cpp.o
[ 85%] Building CXX object ws/CMakeFiles/ws.dir/ws_echo_server.cpp.o
[ 86%] Building CXX object ws/CMakeFiles/ws.dir/ws_connect.cpp.o
[ 88%] Building CXX object ws/CMakeFiles/ws.dir/ws_send.cpp.o
[ 90%] Building CXX object ws/CMakeFiles/ws.dir/ws_receive.cpp.o
[ 91%] Building CXX object ws/CMakeFiles/ws.dir/ws_redis_publish.cpp.o
[ 93%] Building CXX object ws/CMakeFiles/ws.dir/ws_redis_subscribe.cpp.o
[ 96%] Building CXX object ws/CMakeFiles/ws.dir/ws_chat.cpp.o
[ 98%] Building CXX object ws/CMakeFiles/ws.dir/ws_cobra_publish.cpp.o
[ 98%] Building CXX object ws/CMakeFiles/ws.dir/ws_snake.cpp.o
In file included from /Users/bsergeant/src/foss/IXWebSocket/ws/ws.cpp:22:
In file included from /Users/bsergeant/src/foss/IXWebSocket/ws/../third_party/cli11/CLI11.hpp:152:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/experimental/optional:163:4: warning: 
      "<experimental/optional> is deprecated and will be removed in the next release. Please use C++17's
      <optional> instead." [-W#warnings]
#  warning "<experimental/optional> is deprecated and will be removed in the next release. Please us...
   ^
1 warning generated.
[100%] Linking CXX executable ws
[100%] Built target ws
Install the project...
-- Install configuration: "Debug"
-- Installing: /usr/local/lib/libixwebsocket.a
-- Up-to-date: /usr/local/include/ixwebsocket/IXCancellationRequest.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXConnectionState.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXDNSLookup.h
-- Installing: /usr/local/include/ixwebsocket/IXHttpClient.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXNetSystem.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXProgressCallback.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSelectInterrupt.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSelectInterruptFactory.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSetThreadName.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSocket.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSocketConnect.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSocketFactory.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSocketServer.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXUrlParser.h
-- Installing: /usr/local/include/ixwebsocket/IXWebSocket.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketCloseConstants.h
-- Installing: /usr/local/include/ixwebsocket/IXWebSocketCloseInfo.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketErrorInfo.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketHandshake.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketHttpHeaders.h
-- Installing: /usr/local/include/ixwebsocket/IXWebSocketMessage.h
-- Installing: /usr/local/include/ixwebsocket/IXWebSocketMessageQueue.h
-- Installing: /usr/local/include/ixwebsocket/IXWebSocketMessageType.h
-- Installing: /usr/local/include/ixwebsocket/IXWebSocketOpenInfo.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketPerMessageDeflate.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketPerMessageDeflateCodec.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketPerMessageDeflateOptions.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketSendInfo.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketServer.h
-- Installing: /usr/local/include/ixwebsocket/IXWebSocketTransport.h
-- Up-to-date: /usr/local/include/ixwebsocket/LUrlParser.h
-- Up-to-date: /usr/local/include/ixwebsocket/libwshandshake.hpp
-- Installing: /usr/local/include/ixwebsocket/IXSocketMbedTLS.h
-- Installing: /usr/local/bin/ws
Type Ctrl-D to exit prompt...
Connecting to url: ws://127.0.0.1
> Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connection refused
#retries: 1
Wait time(ms): 100
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connection refused
#retries: 2
Wait time(ms): 200
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connection refused
#retries: 3
Wait time(ms): 400
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connection refused
#retries: 4
Wait time(ms): 800
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connection refused
#retries: 5
Wait time(ms): 1600
HTTP Status: 0

^C
(venv) IXWebSocket$ 
(venv) IXWebSocket$ 
(venv) IXWebSocket$ git bisect good                  
Bisecting: 15 revisions left to test after this (roughly 4 steps)
[4cbfa7133863a676f86db81e34218ead20124384] switch from select to poll to deal with Android 9 giving us high socket fds when calling ::connect
(venv) IXWebSocket$ 
(venv) IXWebSocket$ 
(venv) IXWebSocket$ 
(venv) IXWebSocket$ 
(venv) IXWebSocket$ 
(venv) IXWebSocket$ 
(venv) IXWebSocket$ make && ws connect ws://127.0.0.1
mkdir -p build && (cd build ; cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_TLS=1 -DUSE_WS=1 .. ; make -j install)
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/bsergeant/src/foss/IXWebSocket/build
Scanning dependencies of target ixwebsocket
[  1%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXHttpClient.cpp.o
[  3%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXHttp.cpp.o
[  4%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXDNSLookup.cpp.o
[  6%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXHttpServer.cpp.o
[  7%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSocketConnect.cpp.o
[  9%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSocket.cpp.o
[ 10%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSocketServer.cpp.o
[ 12%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocket.cpp.o
[ 14%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketHandshake.cpp.o
[ 15%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketHttpHeaders.cpp.o
[ 17%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketServer.cpp.o
[ 18%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketTransport.cpp.o
[ 20%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSocketMbedTLS.cpp.o
[ 21%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketMessageQueue.cpp.o
[ 23%] Linking CXX static library libixwebsocket.a
[ 45%] Built target ixwebsocket
Scanning dependencies of target ws
[ 46%] Building CXX object ws/CMakeFiles/ws.dir/IXRedisClient.cpp.o
[ 50%] Building CXX object ws/CMakeFiles/ws.dir/ws_httpd.cpp.o
[ 50%] Building CXX object ws/CMakeFiles/ws.dir/IXSentryClient.cpp.o
[ 51%] Building CXX object ws/CMakeFiles/ws.dir/ws.cpp.o
In file included from /Users/bsergeant/src/foss/IXWebSocket/ws/ws.cpp:22:
In file included from /Users/bsergeant/src/foss/IXWebSocket/ws/../third_party/cli11/CLI11.hpp:152:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/experimental/optional:163:4: warning: 
      "<experimental/optional> is deprecated and will be removed in the next release. Please use C++17's
      <optional> instead." [-W#warnings]
#  warning "<experimental/optional> is deprecated and will be removed in the next release. Please us...
   ^
1 warning generated.
[ 53%] Linking CXX executable ws
[100%] Built target ws
Install the project...
-- Install configuration: "Debug"
-- Installing: /usr/local/lib/libixwebsocket.a
-- Up-to-date: /usr/local/include/ixwebsocket/IXCancellationRequest.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXConnectionState.h
-- Installing: /usr/local/include/ixwebsocket/IXDNSLookup.h
-- Installing: /usr/local/include/ixwebsocket/IXHttp.h
-- Installing: /usr/local/include/ixwebsocket/IXHttpClient.h
-- Installing: /usr/local/include/ixwebsocket/IXHttpServer.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXNetSystem.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXProgressCallback.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSelectInterrupt.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSelectInterruptFactory.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSetThreadName.h
-- Installing: /usr/local/include/ixwebsocket/IXSocket.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSocketConnect.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSocketFactory.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSocketServer.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXUrlParser.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocket.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketCloseConstants.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketCloseInfo.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketErrorInfo.h
-- Installing: /usr/local/include/ixwebsocket/IXWebSocketHandshake.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketHttpHeaders.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketMessage.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketMessageQueue.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketMessageType.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketOpenInfo.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketPerMessageDeflate.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketPerMessageDeflateCodec.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketPerMessageDeflateOptions.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketSendInfo.h
-- Installing: /usr/local/include/ixwebsocket/IXWebSocketServer.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketTransport.h
-- Up-to-date: /usr/local/include/ixwebsocket/LUrlParser.h
-- Up-to-date: /usr/local/include/ixwebsocket/libwshandshake.hpp
-- Up-to-date: /usr/local/include/ixwebsocket/IXSocketMbedTLS.h
-- Installing: /usr/local/bin/ws
Type Ctrl-D to exit prompt...
Connecting to url: ws://127.0.0.1
> Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connect error: Operation now in progress
#retries: 1
Wait time(ms): 100
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connect error: Operation now in progress
#retries: 2
Wait time(ms): 200
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connect error: Operation now in progress
#retries: 3
Wait time(ms): 400
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connect error: Operation now in progress
#retries: 4
Wait time(ms): 800
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connect error: Operation now in progress
#retries: 5
Wait time(ms): 1600
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connect error: Operation now in progress
#retries: 6
Wait time(ms): 3200
HTTP Status: 0

^C
(venv) IXWebSocket$ 
(venv) IXWebSocket$ git bisect bad                   
Bisecting: 7 revisions left to test after this (roughly 3 steps)
[6f6c1f85eff29e4d6b4f872883cdb1a70038ece3] CI / build zlib and mbedtls locally
(venv) IXWebSocket$ 
(venv) IXWebSocket$ 
(venv) IXWebSocket$ 
(venv) IXWebSocket$ 
(venv) IXWebSocket$ 
(venv) IXWebSocket$ 
(venv) IXWebSocket$ 
(venv) IXWebSocket$ make && ws connect ws://127.0.0.1
mkdir -p build && (cd build ; cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_TLS=1 -DUSE_WS=1 .. ; make -j install)
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/bsergeant/src/foss/IXWebSocket/build
Scanning dependencies of target ixwebsocket
[  1%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXHttp.cpp.o
[  4%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXHttpServer.cpp.o
[  4%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSocket.cpp.o
[  6%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXHttpClient.cpp.o
[  7%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSocketConnect.cpp.o
[  9%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSocketFactory.cpp.o
[ 10%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocket.cpp.o
[ 12%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSocketServer.cpp.o
[ 15%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketHandshake.cpp.o
[ 15%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketHttpHeaders.cpp.o
[ 17%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketMessageQueue.cpp.o
[ 20%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketServer.cpp.o
[ 21%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSocketMbedTLS.cpp.o
[ 21%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketTransport.cpp.o
[ 23%] Linking CXX static library libixwebsocket.a
[ 45%] Built target ixwebsocket
Scanning dependencies of target ws
[ 46%] Building CXX object ws/CMakeFiles/ws.dir/snake/IXSnakeProtocol.cpp.o
[ 48%] Building CXX object ws/CMakeFiles/ws.dir/snake/IXSnakeServer.cpp.o
[ 50%] Building CXX object ws/CMakeFiles/ws.dir/ixcobra/IXCobraConnection.cpp.o
[ 51%] Building CXX object ws/CMakeFiles/ws.dir/ws_ping_pong.cpp.o
[ 53%] Building CXX object ws/CMakeFiles/ws.dir/ws_http_client.cpp.o
[ 54%] Building CXX object ws/CMakeFiles/ws.dir/ws_broadcast_server.cpp.o
[ 57%] Building CXX object ws/CMakeFiles/ws.dir/ws_echo_server.cpp.o
[ 57%] Building CXX object ws/CMakeFiles/ws.dir/ws_chat.cpp.o
[ 59%] Building CXX object ws/CMakeFiles/ws.dir/ws_connect.cpp.o
[ 60%] Building CXX object ws/CMakeFiles/ws.dir/ws_transfer.cpp.o
[ 64%] Building CXX object ws/CMakeFiles/ws.dir/ws_send.cpp.o
[ 65%] Building CXX object ws/CMakeFiles/ws.dir/ws_cobra_to_sentry.cpp.o
[ 65%] Building CXX object ws/CMakeFiles/ws.dir/ws_receive.cpp.o
[ 67%] Building CXX object ws/CMakeFiles/ws.dir/ws_snake.cpp.o
[ 68%] Linking CXX executable ws
[100%] Built target ws
Install the project...
-- Install configuration: "Debug"
-- Installing: /usr/local/lib/libixwebsocket.a
-- Up-to-date: /usr/local/include/ixwebsocket/IXCancellationRequest.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXConnectionState.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXDNSLookup.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXHttp.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXHttpClient.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXHttpServer.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXNetSystem.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXProgressCallback.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSelectInterrupt.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSelectInterruptFactory.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSetThreadName.h
-- Installing: /usr/local/include/ixwebsocket/IXSocket.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSocketConnect.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSocketFactory.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSocketServer.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXUrlParser.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocket.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketCloseConstants.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketCloseInfo.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketErrorInfo.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketHandshake.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketHttpHeaders.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketMessage.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketMessageQueue.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketMessageType.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketOpenInfo.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketPerMessageDeflate.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketPerMessageDeflateCodec.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketPerMessageDeflateOptions.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketSendInfo.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketServer.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketTransport.h
-- Up-to-date: /usr/local/include/ixwebsocket/LUrlParser.h
-- Up-to-date: /usr/local/include/ixwebsocket/libwshandshake.hpp
-- Up-to-date: /usr/local/include/ixwebsocket/IXSocketMbedTLS.h
-- Installing: /usr/local/bin/ws
Type Ctrl-D to exit prompt...
Connecting to url: ws://127.0.0.1
> Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connection refused
#retries: 1
Wait time(ms): 100
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connection refused
#retries: 2
Wait time(ms): 200
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connection refused
#retries: 3
Wait time(ms): 400
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connection refused
#retries: 4
Wait time(ms): 800
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connection refused
#retries: 5
Wait time(ms): 1600
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connection refused
#retries: 6
Wait time(ms): 3200
HTTP Status: 0

^C
(venv) IXWebSocket$ 
(venv) IXWebSocket$ 
(venv) IXWebSocket$ git bisect good                  
Bisecting: 3 revisions left to test after this (roughly 2 steps)
[06b4762c19cf6ce8c3a264c810cd90fcfa33ea86] disable CI on Windows
(venv) IXWebSocket$ 
(venv) IXWebSocket$ 
(venv) IXWebSocket$ 
(venv) IXWebSocket$ 
(venv) IXWebSocket$ 
(venv) IXWebSocket$ 
(venv) IXWebSocket$ make && ws connect ws://127.0.0.1
mkdir -p build && (cd build ; cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_TLS=1 -DUSE_WS=1 .. ; make -j install)
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/bsergeant/src/foss/IXWebSocket/build
[ 45%] Built target ixwebsocket
Scanning dependencies of target ws
[ 46%] Building CXX object ws/CMakeFiles/ws.dir/IXRedisClient.cpp.o
[ 50%] Building CXX object ws/CMakeFiles/ws.dir/IXSentryClient.cpp.o
[ 50%] Building CXX object ws/CMakeFiles/ws.dir/ws_httpd.cpp.o
[ 51%] Building CXX object ws/CMakeFiles/ws.dir/ws.cpp.o
In file included from /Users/bsergeant/src/foss/IXWebSocket/ws/ws.cpp:22:
In file included from /Users/bsergeant/src/foss/IXWebSocket/ws/../third_party/cli11/CLI11.hpp:152:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/experimental/optional:163:4: warning: 
      "<experimental/optional> is deprecated and will be removed in the next release. Please use C++17's
      <optional> instead." [-W#warnings]
#  warning "<experimental/optional> is deprecated and will be removed in the next release. Please us...
   ^
1 warning generated.
[ 53%] Linking CXX executable ws
[100%] Built target ws
Install the project...
-- Install configuration: "Debug"
-- Installing: /usr/local/lib/libixwebsocket.a
-- Up-to-date: /usr/local/include/ixwebsocket/IXCancellationRequest.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXConnectionState.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXDNSLookup.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXHttp.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXHttpClient.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXHttpServer.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXNetSystem.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXProgressCallback.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSelectInterrupt.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSelectInterruptFactory.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSetThreadName.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSocket.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSocketConnect.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSocketFactory.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSocketServer.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXUrlParser.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocket.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketCloseConstants.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketCloseInfo.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketErrorInfo.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketHandshake.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketHttpHeaders.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketMessage.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketMessageQueue.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketMessageType.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketOpenInfo.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketPerMessageDeflate.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketPerMessageDeflateCodec.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketPerMessageDeflateOptions.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketSendInfo.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketServer.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketTransport.h
-- Up-to-date: /usr/local/include/ixwebsocket/LUrlParser.h
-- Up-to-date: /usr/local/include/ixwebsocket/libwshandshake.hpp
-- Up-to-date: /usr/local/include/ixwebsocket/IXSocketMbedTLS.h
-- Installing: /usr/local/bin/ws
Type Ctrl-D to exit prompt...
Connecting to url: ws://127.0.0.1
> Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connection refused
#retries: 1
Wait time(ms): 100
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connection refused
#retries: 2
Wait time(ms): 200
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connection refused
#retries: 3
Wait time(ms): 400
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connection refused
#retries: 4
Wait time(ms): 800
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connection refused
#retries: 5
Wait time(ms): 1600
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connection refused
#retries: 6
Wait time(ms): 3200
HTTP Status: 0

^C
(venv) IXWebSocket$ 
(venv) IXWebSocket$ 
(venv) IXWebSocket$ git bisect good                  
Bisecting: 1 revision left to test after this (roughly 1 step)
[01bc6654cb92466f89cf029b925107268981a6a5] Add extra check in IXWebSocketCloseTest.cpp
(venv) IXWebSocket$ make && ws connect ws://127.0.0.1
mkdir -p build && (cd build ; cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_TLS=1 -DUSE_WS=1 .. ; make -j install)
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/bsergeant/src/foss/IXWebSocket/build
Scanning dependencies of target ixwebsocket
[  1%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXHttp.cpp.o
[  4%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSocket.cpp.o
[  4%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXHttpClient.cpp.o
[  6%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXHttpServer.cpp.o
[  7%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSocketConnect.cpp.o
[  9%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSocketServer.cpp.o
[ 12%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocket.cpp.o
[ 12%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketHandshake.cpp.o
[ 14%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketMessageQueue.cpp.o
[ 15%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketHttpHeaders.cpp.o
[ 17%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketTransport.cpp.o
[ 18%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketServer.cpp.o
[ 20%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSocketMbedTLS.cpp.o
[ 21%] Linking CXX static library libixwebsocket.a
[ 45%] Built target ixwebsocket
[ 46%] Linking CXX executable ws
[100%] Built target ws
Install the project...
-- Install configuration: "Debug"
-- Installing: /usr/local/lib/libixwebsocket.a
-- Up-to-date: /usr/local/include/ixwebsocket/IXCancellationRequest.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXConnectionState.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXDNSLookup.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXHttp.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXHttpClient.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXHttpServer.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXNetSystem.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXProgressCallback.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSelectInterrupt.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSelectInterruptFactory.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSetThreadName.h
-- Installing: /usr/local/include/ixwebsocket/IXSocket.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSocketConnect.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSocketFactory.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSocketServer.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXUrlParser.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocket.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketCloseConstants.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketCloseInfo.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketErrorInfo.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketHandshake.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketHttpHeaders.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketMessage.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketMessageQueue.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketMessageType.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketOpenInfo.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketPerMessageDeflate.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketPerMessageDeflateCodec.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketPerMessageDeflateOptions.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketSendInfo.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketServer.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketTransport.h
-- Up-to-date: /usr/local/include/ixwebsocket/LUrlParser.h
-- Up-to-date: /usr/local/include/ixwebsocket/libwshandshake.hpp
-- Up-to-date: /usr/local/include/ixwebsocket/IXSocketMbedTLS.h
-- Installing: /usr/local/bin/ws
Type Ctrl-D to exit prompt...
Connecting to url: ws://127.0.0.1
> Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connection refused
#retries: 1
Wait time(ms): 100
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connection refused
#retries: 2
Wait time(ms): 200
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connection refused
#retries: 3
Wait time(ms): 400
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connection refused
#retries: 4
Wait time(ms): 800
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connection refused
#retries: 5
Wait time(ms): 1600
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connection refused
#retries: 6
Wait time(ms): 3200
HTTP Status: 0

^C
(venv) IXWebSocket$ 
(venv) IXWebSocket$ 
(venv) IXWebSocket$ git bisect good                  
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[705625af0a1d7f612bf7930c0620f61b8218a1f9] refactor select code + add protection against large fds (cf Android 9)
(venv) IXWebSocket$ 
(venv) IXWebSocket$ 
(venv) IXWebSocket$ 
(venv) IXWebSocket$ 
(venv) IXWebSocket$ 
(venv) IXWebSocket$ make && ws connect ws://127.0.0.1
mkdir -p build && (cd build ; cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_TLS=1 -DUSE_WS=1 .. ; make -j install)
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/bsergeant/src/foss/IXWebSocket/build
Scanning dependencies of target ixwebsocket
[  3%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXHttp.cpp.o
[  4%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSocketConnect.cpp.o
[  4%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXHttpClient.cpp.o
[  6%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSocket.cpp.o
[  7%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXHttpServer.cpp.o
[ 10%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSocketFactory.cpp.o
[ 12%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSocketServer.cpp.o
[ 12%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocket.cpp.o
[ 14%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketHandshake.cpp.o
[ 15%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketHttpHeaders.cpp.o
[ 17%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketMessageQueue.cpp.o
[ 18%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketServer.cpp.o
[ 20%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXWebSocketTransport.cpp.o
[ 21%] Building CXX object CMakeFiles/ixwebsocket.dir/ixwebsocket/IXSocketMbedTLS.cpp.o
[ 23%] Linking CXX static library libixwebsocket.a
[ 45%] Built target ixwebsocket
Scanning dependencies of target ws
[ 46%] Building CXX object ws/CMakeFiles/ws.dir/snake/IXSnakeServer.cpp.o
[ 48%] Building CXX object ws/CMakeFiles/ws.dir/IXRedisClient.cpp.o
[ 50%] Building CXX object ws/CMakeFiles/ws.dir/snake/IXSnakeProtocol.cpp.o
[ 51%] Building CXX object ws/CMakeFiles/ws.dir/ixcobra/IXCobraConnection.cpp.o
[ 53%] Building CXX object ws/CMakeFiles/ws.dir/ws_http_client.cpp.o
[ 54%] Building CXX object ws/CMakeFiles/ws.dir/IXSentryClient.cpp.o
[ 56%] Building CXX object ws/CMakeFiles/ws.dir/ws_ping_pong.cpp.o
[ 57%] Building CXX object ws/CMakeFiles/ws.dir/ws_broadcast_server.cpp.o
[ 59%] Building CXX object ws/CMakeFiles/ws.dir/ws_chat.cpp.o
[ 60%] Building CXX object ws/CMakeFiles/ws.dir/ws_connect.cpp.o
[ 62%] Building CXX object ws/CMakeFiles/ws.dir/ws_echo_server.cpp.o
[ 64%] Building CXX object ws/CMakeFiles/ws.dir/ws_transfer.cpp.o
[ 65%] Building CXX object ws/CMakeFiles/ws.dir/ws_send.cpp.o
[ 67%] Building CXX object ws/CMakeFiles/ws.dir/ws_receive.cpp.o
[ 68%] Building CXX object ws/CMakeFiles/ws.dir/ws_cobra_to_sentry.cpp.o
[ 70%] Building CXX object ws/CMakeFiles/ws.dir/ws_snake.cpp.o
[ 71%] Building CXX object ws/CMakeFiles/ws.dir/ws_httpd.cpp.o
[ 73%] Building CXX object ws/CMakeFiles/ws.dir/ws.cpp.o
In file included from /Users/bsergeant/src/foss/IXWebSocket/ws/ws.cpp:22:
In file included from /Users/bsergeant/src/foss/IXWebSocket/ws/../third_party/cli11/CLI11.hpp:152:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/experimental/optional:163:4: warning: 
      "<experimental/optional> is deprecated and will be removed in the next release. Please use C++17's
      <optional> instead." [-W#warnings]
#  warning "<experimental/optional> is deprecated and will be removed in the next release. Please us...
   ^
1 warning generated.
[ 75%] Linking CXX executable ws
[100%] Built target ws
Install the project...
-- Install configuration: "Debug"
-- Installing: /usr/local/lib/libixwebsocket.a
-- Up-to-date: /usr/local/include/ixwebsocket/IXCancellationRequest.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXConnectionState.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXDNSLookup.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXHttp.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXHttpClient.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXHttpServer.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXNetSystem.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXProgressCallback.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSelectInterrupt.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSelectInterruptFactory.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSetThreadName.h
-- Installing: /usr/local/include/ixwebsocket/IXSocket.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSocketConnect.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSocketFactory.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXSocketServer.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXUrlParser.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocket.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketCloseConstants.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketCloseInfo.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketErrorInfo.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketHandshake.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketHttpHeaders.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketMessage.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketMessageQueue.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketMessageType.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketOpenInfo.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketPerMessageDeflate.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketPerMessageDeflateCodec.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketPerMessageDeflateOptions.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketSendInfo.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketServer.h
-- Up-to-date: /usr/local/include/ixwebsocket/IXWebSocketTransport.h
-- Up-to-date: /usr/local/include/ixwebsocket/LUrlParser.h
-- Up-to-date: /usr/local/include/ixwebsocket/libwshandshake.hpp
-- Up-to-date: /usr/local/include/ixwebsocket/IXSocketMbedTLS.h
-- Installing: /usr/local/bin/ws
Type Ctrl-D to exit prompt...
Connecting to url: ws://127.0.0.1
> Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connect error: Operation now in progress
#retries: 1
Wait time(ms): 100
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connect error: Operation now in progress
#retries: 2
Wait time(ms): 200
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connect error: Operation now in progress
#retries: 3
Wait time(ms): 400
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connect error: Operation now in progress
#retries: 4
Wait time(ms): 800
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connect error: Operation now in progress
#retries: 5
Wait time(ms): 1600
HTTP Status: 0

Connection error: Unable to connect to 127.0.0.1 on port 80, error: Connect error: Operation now in progress
#retries: 6
Wait time(ms): 3200
HTTP Status: 0

^C
(venv) IXWebSocket$ 
(venv) IXWebSocket$ 
(venv) IXWebSocket$ 
(venv) IXWebSocket$ git bisect bad                   
705625af0a1d7f612bf7930c0620f61b8218a1f9 is the first bad commit
commit 705625af0a1d7f612bf7930c0620f61b8218a1f9
Author: Benjamin Sergeant <[email protected]>
Date:   Tue Jun 25 15:41:39 2019 -0700

    refactor select code + add protection against large fds (cf Android 9)

:100644 100644 09594fdab5040c1d8162e799a58c2181badef4d2 cd9191bc959300f0b03ba31a825b68524fb69f78 M	README.md
:040000 040000 6ba18c9030c09880f53b9078007cc85867d74422 5ed021cf08f752865472e79fb86e0fc3c1eef132 M	ixwebsocket
:040000 040000 0b3248e42c60f7b496f807b8d6764d585af3ea68 94d1835417003b943be533af0aeafc50d76d4d2b M	test
(venv) IXWebSocket$ 

Cannot install ws via brew

I am trying to use this library. I have installed brew and followed the Build instructions. When I run brew install IXWebSocket I get the following:

==> Installing dependencies for ixwebsocket: ncurses, openssl and cmake
==> Installing ixwebsocket dependency: ncurses
==> Downloading https://linuxbrew.bintray.com/bottles/ncurses-6.1.x86_64_linux.bottle.tar.gz
######################################################################## 100.0%
==> Pouring ncurses-6.1.x86_64_linux.bottle.tar.gz
🍺  /home/linuxbrew/.linuxbrew/Cellar/ncurses/6.1: 3,856 files, 15.4MB
==> Installing ixwebsocket dependency: openssl
==> Downloading https://linuxbrew.bintray.com/bottles/openssl-1.0.2q_2.x86_64_linux.bottle.tar.gz
######################################################################## 100.0%
==> Pouring openssl-1.0.2q_2.x86_64_linux.bottle.tar.gz
==> Downloading https://curl.haxx.se/ca/cacert-2019-01-23.pem
######################################################################## 100.0%
==> Caveats
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
  /home/linuxbrew/.linuxbrew/etc/openssl/certs

and run
  /home/linuxbrew/.linuxbrew/opt/openssl/bin/c_rehash
==> Summary
🍺  /home/linuxbrew/.linuxbrew/Cellar/openssl/1.0.2q_2: 1,802 files, 14.5MB
==> Installing ixwebsocket dependency: cmake
==> Downloading https://linuxbrew.bintray.com/bottles/cmake-3.14.0.x86_64_linux.bottle.tar.gz
######################################################################## 100.0%
==> Pouring cmake-3.14.0.x86_64_linux.bottle.tar.gz
==> Caveats
Emacs Lisp files have been installed to:
  /home/linuxbrew/.linuxbrew/share/emacs/site-lisp/cmake
==> Summary
🍺  /home/linuxbrew/.linuxbrew/Cellar/cmake/3.14.0: 5,681 files, 55.0MB
==> Installing ixwebsocket
==> Downloading https://github.com/machinezone/IXWebSocket/archive/v1.1.0.tar.gz
Already downloaded: /home/mlu/.cache/Homebrew/downloads/9b6cfde1c83e8b461f64e344aa8d95cf89011dbd33fd9c701e556ed66d5b28b0--IXWebSocket-1.1.0.tar.gz
==> cmake . -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -DCMAKE_INSTALL_PREFI
==> make install
Last 15 lines from /home/mlu/.cache/Homebrew/Logs/ixwebsocket/02.make:
2019-03-18 14:55:15 -0700

make
install

make: *** No rule to make target 'install'.  Stop.

READ THIS: https://docs.brew.sh/Troubleshooting

Cannot Send Messages to Multiple Connected Clients

I've been trying to send messages to multiple clients connected to a websocket server.
I followed the code used in ws_broadcast_server.cpp and ws_chat.cpp but ran into this issue.

If I start the broadcast_server, then connect who chat clients, I am able to send and receive messages just fine with both clients. However, when I connect a third client, I can send message that reach the server, but will not be received by the first two clients.

Steps to reproduce:

./ws broadcast_server
./ws chat ws://127.0.0.1 bob 
./ws chat ws://127.0.0.1 joe
./ws chat ws::/127.0.0.1 bobjoe     //!< Connected error

Any help would be appreciated.

Thanks

Error in IXDNSLookup

ThreadSanitizer:DEADLYSIGNAL
==91995==ERROR: ThreadSanitizer: SEGV on unknown address 0x7e80000ff0d8 (pc 0x00010b3bfbeb bp 0x7e8000392c60 sp 0x7e8000392a90 T4850109)
==91995==The signal is caused by a WRITE memory access.
    #0 ix::DNSLookup::run() IXDNSLookup.cpp:145 (cmd_run_all:x86_64+0x102d58bea)

==91995==Register values:
rax = 0x00007e80000ff098  rbx = 0x0000000000000010  rcx = 0x00007b0c00015d50  rdx = 0x0001fa0000e4c000  
rdi = 0x00007e8000392920  rsi = 0x000000010b3beef9  rbp = 0x00007e8000392c60  rsp = 0x00007e8000392a90  
 r8 = 0x0000000000000100   r9 = 0x00000000d994cb2d  r10 = 0x000000002120b22a  r11 = 0xffffffcbfffee698  
r12 = 0x00007e80000fe608  r13 = 0x000000010b3c3a90  r14 = 0x00007b080000d940  r15 = 0x000000000a152000  
ThreadSanitizer can not provide additional info.
SUMMARY: ThreadSanitizer: SEGV IXDNSLookup.cpp:145 in ix::DNSLookup::run()
==91995==ABORTING

unittest failed
Execution time: 6.07s

Better story for ca cert handling for OpenSSL and MbedTLS

setenv SSL_CERT_FILE /path/to/cacert file is required on OpenSSL, on Android. We should mention it in the doc. We could also bundle the source code to have a zero configuration experience.

References:

Missing features for nakama-cpp

Hey @Dimon4eg and @Kumamon38

I noticed that you guys have adopted cpprest in nakama-clients, which looks like a very solid library. I understand that you need 'the job done' and will use the right library.

Do you mind elaborating real quick on why you couldn't use IXWebSocket, and the holes it had ?

I would guess:

  • Good windows support
  • Missing TLS on windows
  • Other bugs
  • Other feature I can't think about ?
  • cpp-rest also has a oauth, http client, tasks, etc...

In the future I'd like to change that lib so that it can be more easily adopted by anyone. Thanks for any input, and all the bug fixes you guys have contributed !

Fix setOnMessageCallback() API in README

Looks like everywhere in README file setOnMessageCallback() API is using wrong arguments(maybe some leftover from old code).

Current

webSocket.setOnMessageCallback(
    [](ix::WebSocketMessageType messageType,
       const std::string& str,
       size_t wireSize,
       const ix::WebSocketErrorInfo& error,
       const ix::WebSocketCloseInfo& closeInfo,
       const ix::WebSocketHttpHeaders& headers)

Should be

  webSocket.setOnMessageCallback(
    [](ix::WebSocketMessageType messageType,
       const std::string& str,
       size_t wireSize,
       const ix::WebSocketErrorInfo& error,
       const ix::WebSocketOpenInfo& openInfo,
       const ix::WebSocketCloseInfo& closeInfo)

Ping/Pong support

We need a way to send a ping and fire a callback when a pong is received.

Using INADDR_ANY in SocketServer::listen()

I'm setting up a WebSocketServer on a Linux-based OS, which I am connecting to from both a local client and a client on another computer. I've found that I can only make the second connection if I explicitly set the server's IP address to that of one the machine's network interfaces - if I try to use the loopback address, the incoming connection isn't detected. My goal is to be able to make this connection using the loopback address for my server.

After a bit of reading and tinkering, I've made this work by changing line 94 in IXSocketServer.cpp to set s_addr to INADDR_ANY. The comments before that line mention existing problems with the osx firewall that explain why we default to localhost instead. This implies that there are no known issues with using INADDR_ANY on a Linux-based machine, so I'm guessing this is safe to do in my case. Is it worth setting the s_addr differently depending on the OS while the osx firewall issue remains unresolved?

Add docker instructions in README

I tried docker commands to build and use IXWebSocket inside container but that's not working yet.

$ docker-compose pull
Pulling redis1 ... done
Pulling ws     ... error

ERROR: for ws  manifest for bsergean/ws:build not found
ERROR: manifest for bsergean/ws:build not found

$ docker-compose build
redis1 uses an image, skipping
ws uses an image, skipping

$ docker-compose up -d
Pulling ws (bsergean/ws:build)...
ERROR: manifest for bsergean/ws:build not found

Close description can be un-initialized at time

We can see this easily by running continuously make ws_test. In that run below it it set to Normal closure / but at other times it is set to '%'.

@Dimon4eg + @Kumamon38 / This is likely a regression of 935e679

I think this is why I was only setting the close reason only once in a weird way, like the first time it gets sets in one of the callbacks.

Received 61 bytes
ws_transfer: 0 bytes left to be sent
ws_send: received message (61 bytes)
Done !
ws_send: connection closed: code 1000 reason Normal closure

Closed connection code 1000 reason %
WebSocketServer::handleConnection() done
Received file does exists, exiting loop
1897227451 20480000 /tmp/ws_test/send/20M_file
1897227451 20480000 /tmp/ws_test/receive/20M_file
Done !
Closed connection code ws_receive: connection closed: code 1000 reason Normal closure
0
 reason 
WebSocketServer::handleConnection() done

another run

ws_send: received message (61 bytes)
ws_send: connection closed: code 1000 reason Normal closure

Closed connection code 1000 reason ??
WebSocketServer::handleConnection() done
Received file does exists, exiting loop
4293923412 20480000 /tmp/ws_test/send/20M_file
4293923412 20480000 /tmp/ws_test/receive/20M_file
Done !
ws_receive: connection closed: code 1000 reason Normal closure
Closed connection
 code 1000 reason ac

ws does not compile on OS Ubuntu 17

Hi @bsergean ,
I went going to use ws without docker and compile it directly on my OS ubuntu 17.X.
but I've gotten the following error:

/home/osboxes/Project/IXWebSocket/ws/ixcobra/IXCobraMetricsPublisher.cpp: In member function ‘void ix::CobraMetricsPublisher::push(const string&, const Json::Value&, bool)’:
/home/osboxes/Project/IXWebSocket/ws/ixcobra/IXCobraMetricsPublisher.cpp:187:54: error: conversion from ‘uint64_t {aka long unsigned int}’ to ‘const Json::Value’ is ambiguous
         msg["timestamp"] = getMillisecondsSinceEpoch();
                                                      ^
In file included from /home/osboxes/Project/IXWebSocket/ws/ixcobra/IXCobraConnection.h:11:0,

could you please help me.

[bug]websocket connection failed because WSAStartup not called on windows

problem: websocket connection failed because WSAStartup not called on windows
version 4.0.3
source: vcpkg

I need to call the WSAStartup and WSACleanup functions manually, and docs doesn't say it...
when I built it from the latest source code, the poll.h header is missing, does it support windows in the future?

Include path and Library

dear @bsergean ,
I'm writing a client server program with c++ and Eclipse IDE.
after that IXWebsocket installation was completed, I included the path: /usr/local/include/ixwebsocket and added the library ixwebsocket to the Eclipse .
but when I build my sample code you provided as a sample, I get the following error:

/usr/local/lib/libixwebsocket.a(IXWebSocketPerMessageDeflateCodec.cpp.o): In function `ix::WebSocketPerMessageDeflateCompressor::~WebSocketPerMessageDeflateCompressor()':
IXWebSocketPerMessageDeflateCodec.cpp:(.text+0x82): undefined reference to `deflateEnd'

Here is my sample code :

#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <condition_variable>
#include <mutex>
#include <chrono>
#include <ixwebsocket/IXWebSocket.h>
using namespace std;

int main(int argc, char** argv)
{


	ix::WebSocket webSocket;

	std::string url("ws://localhost:8080/");
	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);

	// Setup a callback to be fired when a message or an event (open, close, error) is received
	webSocket.setOnMessageCallback(
	    [](ix::WebSocketMessageType messageType,
	       const std::string& str,
	       size_t wireSize,
	       const ix::WebSocketErrorInfo& error,
	       const ix::WebSocketOpenInfo& openInfo,
	       const ix::WebSocketCloseInfo& closeInfo)
	    {
	        if (messageType == ix::WebSocketMessageType::Message)
	        {
	            std::cout << 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 BINARY mode)
	webSocket.send("hello world");

	// The message can be sent in TEXT mode
	webSocket.sendText("hello again");

	// ... finally ...

	// Stop the connection
	webSocket.stop();


}

is there any other library that I have to include in my project?

Need help for Multi-threading

Hi friend @bsergean,
I know my question is not completely related to your great library, but I need some advice to take full advantage of IXWebsocket and I will be thankful if you help me.
I use the IXWebsocket' client (only client not server) in a multi-threading application(one instance in 10 threads) which transmits data with len=500000 (~500kb) to the server.
1.Is there any configuration that I should disable? because of not using the onMessage event on the client side?
2. Should I use mutex.lock when I use sendText function?
3.everything is going well when the app and server are both on the same machine but when I test it on the real word or Internet, the client takes high processing cost. is there any recommendation to handle this situation?

System Specification:
Server : Ubuntu with Tomcat for socket server
Client : Raspbian Model B+ with Processing unit 1.2 GHz

Integer overflow in receiving code

(quoting the email exchange with a reporter)

There is an integer overflow on the receiving frame size

if (_rxbuf.size() < ws.header_size + ws.N)
that can be used to sneak past the guard clause _rxbuf.size() < ws.header_size + ws.N check.

Should be a simple fix - either by adding a reasonable limit to the ws.N value or checking for overflow before doing the addition. According to the websocket spec "the most significant bit MUST be 0" so that is a safe and simple check to do.

command line help info not match

I found ws cmd help info SUBCOMMAND after options, but in fact the cmd is ./ws SUBCOMMAND [OPTIONS]

./ws --help                             
ws is a websocket tool
Usage: ./ws [OPTIONS] SUBCOMMAND

Windows: Basic echo fails to connect on 5.0.4

5.0.4 and Windows don't appear to get along. All my unit tests are failing on 5.0.4, and attempting to compile it locally (git clone https://github.com/lunarwatcher/conan-ixwebsocket && cd conan-ixwebsocket && conan create . IXWebSocket/LunarWatcher) successfully compiles it, but prints errors:

ERROR: Unable to connect to echo.websocket.org on port 80, error: Connect error: No error
ERROR: Unable to connect to echo.websocket.org on port 80, error: Connect error: No error
ERROR: Unable to connect to echo.websocket.org on port 80, error: Connect error: No error
ERROR: Unable to connect to echo.websocket.org on port 80, error: Connect error: No error
ERROR: Unable to connect to echo.websocket.org on port 80, error: Connect error: No error
ERROR: Unable to connect to echo.websocket.org on port 80, error: Connect error: No error
ERROR: Unable to connect to echo.websocket.org on port 80, error: Connect error: No error

These aren't visible in the CI builds (I have no idea why)

For reproducibility, the code:

#include <iostream>
#include <ixwebsocket/IXWebSocket.h>
#include <string>
#include <vector>
#include <chrono>
#include <thread>
#include <ixwebsocket/IXNetSystem.h>

class SocketWrapper {
private:
    ix::WebSocket webSocket;
    std::vector<std::string> receivedMessages;
public:
    SocketWrapper() {
        webSocket.setUrl(std::string("ws://echo.websocket.org"));
        webSocket.setOnMessageCallback(
            [this](const ix::WebSocketMessagePtr& message) {
                if (message->type == ix::WebSocketMessageType::Open) {
                    std::cout << "Connected\n";
                    //webSocket.send(std::string("Congrats, your local version of IXWebSocket works!"));
                } else if (message->type == ix::WebSocketMessageType::Close) {
                    std::cout << "Closing socket...\n";
                } else if (message->type == ix::WebSocketMessageType::Message) {
                    std::cout << "Message received from server: " << message->str << std::endl;
                    receivedMessages.push_back(message->str);
                } else if (message->type == ix::WebSocketMessageType::Error) {
                    std::cout << "ERROR: " << message->errorInfo.reason << std::endl;
                } 
            });
        webSocket.start();

    }

    bool hasReceived() { return receivedMessages.size() > 0; }
    void close() { this->webSocket.close(); }
    bool ready() { 
        return this->webSocket.getReadyState() == ix::ReadyState::Open; 
    }
    void send(std::string message) { this->webSocket.send(message); }
};

int main() {
    std::cout << "Starting socket..." << std::endl;
    ix::initNetSystem(); // required for Windows
    SocketWrapper socketWrapper;
    int counter = 0;
    while(true) {
        std::this_thread::sleep_for(std::chrono::milliseconds(2000));
        counter++;
        if (socketWrapper.hasReceived()) {
            break;
        } else if (counter >= 5) {
            socketWrapper.close();
            ix::uninitNetSystem(); 
            throw "No response for 10 seconds: assuming failure";
        }

        if (socketWrapper.ready()) {
            socketWrapper.send("Congrats, your local version of IXWebSocket works!");
        }
    }
    std::cout << "Message received! Closing socket." << std::endl;
    socketWrapper.close();
    std::cout << "Socket disconnected." << std::endl;

    ix::uninitNetSystem(); // required for Windows.
}

For context, all the builds on 5.0.4 pass on Linux and Mac. The code is also identical in the 5.0.0 build and 5.0.4 build. I'm pretty sure this is triggered by v5.0.4 (or one of the versions in between that didn't work on Windows), but it could of course be my fault, but when it works on the other two operating systems and I have ix::initNetSystem(), I can't find anything else that could trigger it

default disable TSL

I use "cmake -DUSE_TLS=1 ../" to enable TLS. It should be mentioned in README.md .

Use existing cross-platform socket library

During supporting Windows for IXW, I've made part of same work which is already done and well tested in this project:
https://github.com/halx99/yasio/blob/master/yasio/xxsocket.h

A lightweight & stable cross-platform support library with a focus on asynchronous socket I/O, support win32 & linux & apple & android
This lib has been used by project http://hongjing.qq.com/ and run at millions of devices.

Also we can use his asio for async operations:
https://github.com/halx99/yasio/blob/master/yasio/yasio.h

Currently IXW doesn't have poll or similar method which I need to avoid multi-threading issues: IWX executes callbacks from internal threads.
The yasio has dispatch_events for this.

I think better to use it to save time and avoid headache.
I believe after using it all tests will pass on Windows.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.