In TLS build of library, support both TLS and non-TLS connections.
The choice is made at runtime, if a TLS URI (https:// or wss://) is given, the TLS client will be used, otherwise the non-TLS client will be used.
Additionally, a new constructor is introduced allowing the URI to be passed at construction, which allows the above selection to occur, otherwise only the default for the library (TLS or non-TLS) will be used (preserving the original behavior).
This allows libsioclient_tls.a to support both TLS and non-TLS connections, chosen at runtime, without recompiling.
With this change, you can now do the following:
sio::client* c1;
sio::client* c2;
c1 = new sio::client("https://foo/");
c2 = new sio::client("http://foo/");
c1->connect();
c2->connect();
NOTE: this will have a small merge conflict with https://github.com/socketio/socket.io-client-cpp/pull/136.
Hi,
When will this be merged?
Is there any progress/update here?
Hi! I'll take a look. I think the main developer is not around any more and I'm mostly in charge of maintaining the CMake but let's see what I can do.
Okay @joelnordell I opened a PR to update it to the state of master https://github.com/ErisExchange/socket.io-client-cpp/pull/5