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: curl with websockets

From: Stefan Eissing via curl-users <curl-users_at_lists.haxx.se>
Date: Fri, 17 Jun 2022 14:26:29 +0200

> Am 17.06.2022 um 13:23 schrieb Daniel Stenberg <daniel_at_haxx.se>:
>
> On Fri, 17 Jun 2022, Stefan Eissing wrote:
>
>> echo "hello little ws" | curl wss://example.com/
>
> Yes, but I was also thinking sending a default message and then go into the interactive mode. Like this:
>
> $ curl -d "hello little ws" wss://example.com/
> yes
> you
> silly
> ^d
>
> With some initial feedback via Twitter my list of ideas now looks like this:
>
> - Read stdin and send off as messages. Consider newline as end of fragment.
> (default to text? offer option to set binary)

There are --data-* options for that, I guess?

> - Respond to PINGs automatically
> - Issue PINGs at some default interval (option to switch off/change
> interval?)

Something like --keepalive-time on the ws layer. Unimaginative --ws-keepalive-time

> - Allow `-d` to specify (initial) data to send (should the format allow for
> multiple separate frames?)
> - Exit after N messages received, where N can be zero.

Or a duration.
  --ws-receive-timeout N: expect non-ping response data at least every N fractional seconds
  --ws-receive-duration N: close the websocket after N fractional seconds, not matter if data has been received or not

>
> --
>
> / 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/listinfo/curl-users
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2022-06-17