custom_websocket_client is a C++ WebSocket client example based on the IXWebSocket library. This project demonstrates how to implement connections with a WebSocket server, send and receive messages, and ensure thread-safe transmissions with simple code.
- Connect and disconnect from WebSocket servers
- Send and receive text/binary messages
- Thread-safe message transmission
- Connection status and error reporting
- Install IXWebSocket Library
- Install IXWebSocket using vcpkg, source build, or other methods.
- CMake Build
mkdir build cd build cmake .. cmake --build .
Run the generated executable (ws_client) after building.
./ws_clientAfter starting the program, enter a message to send it to the server. Messages received from the server will be displayed in the console. Type exit to terminate the program.
- IXWebSocket
- C++17 or later
- CMake 3.10 or later
- (Linux) OpenSSL, pthread, etc.
MIT License (see LICENSE file)