mirror of
https://github.com/curl/curl.git
synced 2026-08-25 03:23:32 +03:00
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
This commit is contained in:
parent
756c0718c2
commit
37cecfc7b9
17 changed files with 878 additions and 156 deletions
2
docs/examples/.gitignore
vendored
2
docs/examples/.gitignore
vendored
|
|
@ -19,6 +19,7 @@ ephiperfifo
|
|||
evhiperfifo
|
||||
externalsocket
|
||||
fileupload
|
||||
ftp-delete
|
||||
ftp-wildcard
|
||||
ftpget
|
||||
ftpgetinfo
|
||||
|
|
@ -129,4 +130,5 @@ urlapi
|
|||
usercertinmem
|
||||
websocket
|
||||
websocket-cb
|
||||
websocket-updown
|
||||
xmlstream
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue