easywsclient icon indicating copy to clipboard operation
easywsclient copied to clipboard

Support for SSL - WSS

Open srini-murthy opened this issue 10 years ago • 14 comments

Dear Author,

Great work on this- I was able to compile this module on a toolchain

Continuing along, I am not able to connect to WSS sever. How can I make this to code work for SSL support. What extra library is required for this.

I installed openssl-util, libopenssl as well but not able to succeed

Any advice on this greatly appreciated

Sincere Regards, BREL

srini-murthy avatar Feb 09 '15 16:02 srini-murthy

Hi,

an "easy" way to get WSS (and maybe even proxy support) to work is to use libcurl for the https connection. See here for example: https://github.com/donpillou/MegucoData/blob/master/Src/Markets/Tools/Websocket.cpp (Unfortunately, this code depends on another library, hence it is probably not suitable for everyone.)

Best regards, Donpillou.

donpillou avatar Feb 09 '15 18:02 donpillou

Dear Author,

Thank you very much for the reply, deeply appreciated.

As advised, I started compiling the new wss code for the tool chain, unfortunately it is bringing dependency on libnstd and new make file type Mare. hummm

Any thoughts, why we are not using standard C++ library instead of libnstd and Makefile instead of Marefile

Sincere Regards, BREL

srini-murthy avatar Feb 10 '15 13:02 srini-murthy

Hi,

Any thoughts, why we are not using standard C++ library instead of libnstd and Makefile instead of Marefile

This was my personal choice. (I hate STL for various reasons and I needed a Visual Studio project file generator.) The code is just example that should show you how libcurl can be used. I do not recommend using it as it is right now. You are welcome to port this code back to the C++ Standard Library and to use the build system of your choice.

Best regards, Donpillou.

donpillou avatar Feb 10 '15 17:02 donpillou

@srini-murthy, the lack of wss support is a limitation of the current design of easywsclient. You can do what some other people have done, like @donpillou above or what @ahtsiu did in #29 (9111a6af972c4479efa7a36172dacab9b). There is a new design described in #31, which will permanently fix this issue, but there is no ETA on the new design yet.

dhbaird avatar Feb 11 '15 03:02 dhbaird

Dear Author, Sorry for the late reply, I was on vacation with my family. Thank you very much for the reply with needful information I will work through this and revert back any questions. again, much appreciated High Regards, BREL

srini-murthy avatar Feb 18 '15 15:02 srini-murthy

Has there been any movement on this?

I'm looking for a websocket library to use for a project of mine as this one seems to be a perfect fit, but I need support for SSL.

Quinny avatar Mar 16 '17 21:03 Quinny

+1 on ssl

ghost avatar Aug 23 '17 19:08 ghost

I confirm that @ahtsiu 's code works without any URL parser problem.

blerest avatar Dec 03 '17 12:12 blerest

Howdy, we just open-sourced a library that is based on easywsclient, which has SSL support on macOS, iOS (AppleSSL) and Linux (OpenSSL).

We essentially just made what was proposed in #31 / I added an abstraction for a socket. The code does not compile on Windows though.

There are other changes too, such as the use of a background thread which take care of receiving the messages, while the 'main thread' start + stop the connection, and can send messages.

Thanks a ton for this super simple library which we used as a base and got us where we are today. I like the 'zero dependency' of easywsclient. Our lib also doesn't depend on much, only the platform stuff. No boost dependency for example.

bsergean avatar Oct 05 '18 20:10 bsergean

Forgot the link ... https://github.com/machinezone/IXWebSocket

bsergean avatar Oct 05 '18 20:10 bsergean

I've created my own library based on this project and GameSparksSDK, and it supports wss !!

the link is https://github.com/rottor12/WsClientLib

currently it is targeting Windows environment

@Quinny @rawmaterials

rottor12 avatar Apr 09 '19 16:04 rottor12

I took a look at your lib @rottor12 / it's interesting to see practical uses of mbedtls.

bsergean avatar Apr 09 '19 18:04 bsergean

@bsergean actually it complements your IXWebSocket lib as it is aimed at windows environment

I want to keep it small and simple, currently it is below 1000 lines of code

rottor12 avatar Apr 09 '19 20:04 rottor12

Yep I love the simplicity of easywsclient / I'm sure that many people have used it as a base for different things, such as your library or mine.

I've been wanting to add windows support for IXWebSocket but my main blocker is that I don't have a windows box :)

bsergean avatar Apr 09 '19 20:04 bsergean