Open frextrite opened 2 days ago
Am I missing any configuration to enable the usage of
curl_ws_recv
andcurl_ws_send
functions or is it something that is currently not supported by the crate?
curl-rust generally hasn't had the goal to be an exhaustive binding to the complete libcurl API, but rather only including things that people need. Nobody has asked for websocket support before which is why it is not currently implemented.
That said, if it were me, I would probably not seek out curl as my first choice of library for doing websockets in Rust, unless I was already using it in my project.
Edit: README mentions the bindings are developed using curl 7.24.0 but the latest package references libcurl 8.10.1. What gives?
curl-rust dynamically links to libcurl by default, which means in order to be backwards compatible with older versions of libcurl that may be present on older systems, by default curl-rust does not hard link to any libcurl functions which were introduced more recently. If curl-sys
contained symbols only present in newer libcurl versions, then curl-sys
would produce a linking error on systems that don't have the latest version of libcurl installed system-wide, which is probably a large number of systems.
I am exploring usage of websockes with curl-rust and looking for pointers on the same. Specifically I'm trying out the connect only model mentioned in libcurl documentation.
But from the looks of it
curl::easy::connect_only(enable: bool)
does not allow settings an integer value (specifically2
in case of Websockets).Since the high-level Easy2 APIs didn't support this, I explored the lower-level
curl-sys
ffi APIs which do support this even though it looks like I'm reinventing the wheel and using a lot ofunsafe
rust. On exploring further I wasn't able to find the core websockets functions -curl_ws_recv
andcurl_ws_send
incurl-sys
even though it is based on libcurl 8.10.1 which definitely supports these APIs.Am I missing any configuration to enable the usage of
curl_ws_recv
andcurl_ws_send
functions or is it something that is currently not supported by the crate?Edit: README mentions the bindings are developed using curl 7.24.0 but the latest package references libcurl 8.10.1. What gives?