There is a question confused me for years: what is a good C++ websocket client?
Previously I was using CppRestSDK, but it is now put in maintenance mode and hasn't received an update for years.
I've looked into some alternatives, some are not actively maintained or has a small user group, some are a bit difficult to use and looks error-prone. Finally I chose Mongoose, it didn't work like a charm, but after some hacks, it gets the job done.
Probably due to its focus on embedded and resource intensive area, it seems it doesn't provide a way to validate the TLS certificate using the system's trust store. And if a CA file is provided with the OpenSSL implementation, it must not be an intermediate CA 1. Did a hack for it and it works for me.
The mg_send function only append to buffer and may has the risk of mixing 2 packets.
https://stackoverflow.com/a/58096133 ↩