curl / Mailing Lists / curl-users / 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: [Question / Feature Request] Sending data within WebSocket connection through curl CLI

From: Snusmumr1000 via curl-users <curl-users_at_lists.haxx.se>
Date: Mon, 11 Dec 2023 11:58:53 +0100

Thank you for the detailed answer.

As for the UX, I could try to propose the flows below.

IMO, there could be two modes: interarctive CLI (like in websocat CLI (
github <https://github.com/vi/websocat>)), and via file sockets.

1. Interactive (Websocat-like)
A user connects to a websocket server.
They see incoming messages in their stdout line-by-line (i.e. a new message
= a new line, or ideally it should be possible to select a delimiter).
They can type something in the terminal, press "Enter", and it will be sent
as a message to the server.
I personally find this method suitable for some unintensive websocket
message exchange or fast manual debugging.

 2. File sockets
A user connects to a websocket server with some option like --input-socket
<socket-path>.
They can send some data to <socket-path> with a proper delimiter, then the
data is pulled, splitted by the delimiter, and sent to the server.
I personally find this method suitable for some more-or-less intensive and
automated message exchange.

Hope my ideas will make some sense,
TH

пн, 11 дек. 2023 г. в 11:16, Daniel Stenberg <daniel_at_haxx.se>:

> On Mon, 11 Dec 2023, Snusmumr1000 wrote:
>
> > It's awesome that libcurl has this feature, it is also pretty helpful
> for
> > me. However, my initial question was regarding curl CLI, not regarding
> the
> > library itself. I wonder if curl CLI has such an ability to send WS
> messages
> > to a server interactively like in websocat CLI or in any other possible
> way.
>
> It does not.
>
> My plan is to make the implementation correct and "accepted" for libcurl
> first, and then move on to make sure that it can be used in a good way by
> the
> command line tool as well.
>
> I was also hoping that websocket would find user interest so that
> contributors
> would show up helping us get all of these details improved and ultimately
> landed as non-experimental.
>
> In absense of that, I will certainly get to this myself eventually, but
> recently I have focused on other areas in the project. There is no time
> schedule for when this will happen, and frankly I don't even yet have a
> clear
> picture exactly what we need to do to make websocket support for the curl
> tool
> excellent and a joy to use. If you have ideas on how you ideally would
> want it
> to work, let us know!
>
> --
>
> / daniel.haxx.se
> | Commercial curl support up to 24x7 is available!
> | Private help, bug fixes, support, ports, new features
> | https://curl.se/support.html
>


-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-users
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2023-12-11