Buy commercial curl support. 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 Daniel himself.
Re: how to keep connection open after receiving the last response?
- Contemporary messages sorted: [ by date ] [ by thread ] [ by subject ] [ by author ] [ by messages with attachments ]
From: Daniel Stenberg via curl-users <curl-users_at_lists.haxx.se>
Date: Wed, 15 Oct 2025 14:03:34 +0200 (CEST)
On Wed, 15 Oct 2025, Adrien Kunysz via curl-users wrote:
> I have come to appreciate using curl for most of my HTTP troubleshooting
> needs. However there is one use case where I had to fall back to netcat and
> writing my requests manually. To validate the HTTP/1.1 keepalive mechanism
> of a server, it is useful to send a request, read the response and wait
> "forever" until the server closes the connection. I have not found any way
> to do this with curl.
curl does transfers. When the last transfer is done, it exits back to the
shell.
To validate keepalive in a server, just do a second transfer on the same
command line and ask curl to tell you how many connections it needed. Or just
read the verbose output that tells if it reuses a connection vs creates a new.
Or make the last transfer just never end so that curl will sit waiting for the
transfer to complete.
> Is there a way to do the same with curl? If not, would that be an acceptable
> feature request?
What exactly what that be useful for except for your quite particular niche
use case? And how long would just sit there keeping the connection alive
without doing anything?
Date: Wed, 15 Oct 2025 14:03:34 +0200 (CEST)
On Wed, 15 Oct 2025, Adrien Kunysz via curl-users wrote:
> I have come to appreciate using curl for most of my HTTP troubleshooting
> needs. However there is one use case where I had to fall back to netcat and
> writing my requests manually. To validate the HTTP/1.1 keepalive mechanism
> of a server, it is useful to send a request, read the response and wait
> "forever" until the server closes the connection. I have not found any way
> to do this with curl.
curl does transfers. When the last transfer is done, it exits back to the
shell.
To validate keepalive in a server, just do a second transfer on the same
command line and ask curl to tell you how many connections it needed. Or just
read the verbose output that tells if it reuses a connection vs creates a new.
Or make the last transfer just never end so that curl will sit waiting for the
transfer to complete.
> Is there a way to do the same with curl? If not, would that be an acceptable
> feature request?
What exactly what that be useful for except for your quite particular niche
use case? And how long would just sit there keeping the connection alive
without doing anything?
-- / daniel.haxx.se || https://rock-solid.curl.dev -- Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-users Etiquette: https://curl.se/mail/etiquette.htmlReceived on 2025-10-15