dhbaird / easywsclient

A short and sweet WebSocket client for C++
MIT License
749 stars 204 forks source link

Support for SSL - WSS #39

Open srini-murthy opened 9 years ago

srini-murthy commented 9 years ago

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

donpillou commented 9 years ago

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.

srini-murthy commented 9 years ago

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

donpillou commented 9 years ago

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.

dhbaird commented 9 years ago

@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.

srini-murthy commented 9 years ago

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

Quinny commented 7 years ago

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.

ghost commented 7 years ago

+1 on ssl

blerest commented 6 years ago

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

bsergean commented 6 years ago

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 commented 6 years ago

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

rottor12 commented 5 years ago

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

bsergean commented 5 years ago

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

rottor12 commented 5 years ago

@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

bsergean commented 5 years ago

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 :)