curl / Mailing Lists / curl-library / Single Mail


Re: How to Set Keep Alive Option in CURL

From: Daniel Stenberg <>
Date: Wed, 4 Jan 2017 17:33:31 +0100 (CET)

On Wed, 4 Jan 2017, Praveen Pvs wrote:

> if we use keep alive options also host could still close the connection
> which is happening in my case.

Absolutely. No keep alive options will help much in your case.

> Adding to the question on top of this: In this link

That's a draft for a header specification that never went into the HTTP spec.
Read RFC 7230 for understanding how HTTP 1.1 works.

> Below is the header generated by curl after enabling keep-alive. Why am I
> not seeing connection type and keepalive timeout in the headers ?

Because HTTP 1.1 has no such headers. Persistent connections are by default
and connections will be kept alive by the server for a while after use, but it
isn't normally advertised by the server. Clients and browsers also tend to
keep connections alive for N seconds after use.

List admin:
Received on 2017-01-04