I want to access a WebSocket API using C++ on Linux. I've seen different librarys (like libwebsockets or websocketpp), but I'm not sure which I should use. The only thing I need to do is connect to the API and receive data to a string. So I'm looking for a very basic and simple solution, nothing too complex. Maybe someone has already made experience with a WebSocket library?
相关问题
- Sorting 3 numbers without branching [closed]
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
- What uses more memory in c++? An 2 ints or 2 funct
For a high-level API, you can use
ws_client
from the cpprest library {it wraps websocketpp}.A sample application that runs against the echo server:
Here
.wait()
method is used to wait on tasks, however the code can be easily modified to do I/O in the asynchronous way.