curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

RE: About a websockets write callback

From: Daniel Stenberg via curl-library <>
Date: Tue, 21 Jun 2022 19:10:43 +0200 (CEST)

On Mon, 20 Jun 2022, Dmitry Karpov via curl-library wrote:

> Yes, it would be nice to have just one callback for all WS modes (RAW,
> FRAME, MESSAGE) but using CURLOPT_WRITEFUNCTION callback for that purpose
> doesn't seem like an optimal solution to me because of the problems related
> to passing curl handle to it and making a function call to get WS context
> metadata.

Right, we have to pick one of the two ways where neither is optimal.

I still think I'm going to try with a single CURLOPT_WRITEFUNCTION callback to
start with and a "curl_ws_meta()" function that can be used from within that
callback to get additional data about the frame - when used in frame mode.

I think getting something working that we can try with is a good thing and
then if this turns out feeling too awkward and special, we can switch it
around and do a separate callback option instead.

  | Commercial curl support up to 24x7 is available!
  | Private help, bug fixes, support, ports, new features
Received on 2022-06-21