curl-curl/include/curl
Stefan Eissing 37cecfc7b9
websocket: support CURLOPT_READFUNCTION
Add support for CURLOPT_READFUNCTION with WebSocket urls when *not* in
connect-only mode, e.g. when using curl_multi_perform.

Install the callback function and set CURLOPT_UPLOAD. Return
CURL_READFUNC_PAUSE when having nothing more to send and unpause the
transfer when more data is ready.

This will send the read bytes in a WebSocket BINARY frame.

Add support for this mode in the pytest "ws_data" client and have all
tests run in 'curl_ws_send/recv' and 'peform' mode as well.

Add `curl_ws_start_frame()`. Document, cover in libcurl-ws.md and
explain the READFUNCTION mode for websockets.

Add example `websocket-updown` for this.

Closes #17683
2025-08-11 23:28:54 +02:00
..
curl.h CURLOPT: replace (long) cast with L suffix for CURLHSTS_* macros 2025-08-01 23:58:17 +02:00
curlver.h RELEASE-NOTES: synced 2025-07-27 18:03:13 +02:00
easy.h tidy-up: prefer ifdef/ifndef for single checks 2025-07-27 22:35:17 +02:00
header.h tidy-up: prefer ifdef/ifndef for single checks 2025-07-27 22:35:17 +02:00
Makefile.am checksrc: avoid extra runs in CI, enable more check locally, fix fallouts 2025-05-19 18:59:50 +02:00
mprintf.h tidy-up: prefer ifdef/ifndef for single checks 2025-07-27 22:35:17 +02:00
multi.h multi: change prefix for the network change bits to CURLMNWC_ 2025-08-05 13:05:59 +02:00
options.h tidy-up: prefer ifdef/ifndef for single checks 2025-07-27 22:35:17 +02:00
stdcheaders.h copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
system.h tidy-up: prefer ifdef/ifndef for single checks 2025-07-27 22:35:17 +02:00
typecheck-gcc.h tidy-up: whitespace, indent, #if 0 2025-07-30 03:46:21 +02:00
urlapi.h tidy-up: prefer ifdef/ifndef for single checks 2025-07-27 22:35:17 +02:00
websockets.h websocket: support CURLOPT_READFUNCTION 2025-08-11 23:28:54 +02:00