curl / Mailing Lists / curl-users / Single Mail
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.

how to keep connection open after receiving the last response?

From: Adrien Kunysz via curl-users <curl-users_at_lists.haxx.se>
Date: Wed, 15 Oct 2025 10:47:47 +0000

Greetings curl-users,

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.

This is what I resorted to:

        $ printf 'GET / HTTP/1.1\r\nHost: %s\r\n\r\n' $host | /bin/time -f %E nc $host $port > /dev/null

Is there a way to do the same with curl? If not, would that be an acceptable feature request?

Regards,
Adrien Kunysz
-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-users
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2025-10-15