socket.io-client-cpp icon indicating copy to clipboard operation
socket.io-client-cpp copied to clipboard

In TLS build of library, support both TLS and non-TLS connections.

Open joelnordell opened this issue 9 years ago • 6 comments

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();

joelnordell avatar Dec 08 '16 23:12 joelnordell

NOTE: this will have a small merge conflict with https://github.com/socketio/socket.io-client-cpp/pull/136.

joelnordell avatar Dec 08 '16 23:12 joelnordell

Hi,

When will this be merged?

mmihic96 avatar Jul 28 '21 11:07 mmihic96

Is there any progress/update here?

Vicidel avatar Jun 29 '23 09:06 Vicidel

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.

jmigual avatar Jun 30 '23 07:06 jmigual

Okay @joelnordell I opened a PR to update it to the state of master https://github.com/ErisExchange/socket.io-client-cpp/pull/5

jmigual avatar Jun 30 '23 10:06 jmigual