feat(libhttp): integrate WebSocket client into HttpClient

Merge WebSocket client functionality into HttpClient using Boost.Beast,
enabling a single client instance to handle both HTTP (libcurl) and
WebSocket (ws:// and wss://) protocols. Backward-compatible type aliases
(WebSocketClient, WebSocketClientBase) preserve existing code.

Changes:
- Add synchronous WebSocket client: ws_connect/ws_send/ws_recv/ws_close
- Support ws:// (plain TCP) and wss:// (TLS with SNI) connections
- Layered stream architecture with beast::tcp_stream for timeout support
- Binary message support via ws_send_binary()
- Update Makefile to link libcurl (-lcurl)
- Add README.md documenting unified HttpServer + HttpClient API
This commit is contained in:
qing committed 2026-08-01 04:59:47 +08:00
1 parent 5edb67b46d
commit 9815ff44af
3 files changed
+504 -20

No files matched your search

+1 -1
View File
@@ -7,7 +7,7 @@ INCLU_SDIR := inc
CPP := g++
INCS := -I inc -I/opt/homebrew/include
CPPFLAGS := --std=c++20 -O3 -pipe -Wall -Werror
LIBS := -L/opt/homebrew/lib -lssl -lcrypto -lpthread
LIBS := -L/opt/homebrew/lib -lssl -lcrypto -lcurl -lpthread
BUILD_TDIR := build
$(shell mkdir -p $(BUILD_TDIR))