cURL / Mailing Lists / curl-library / Single Mail


Re: Question about proxying using curl

From: Daniel Stenberg <>
Date: Fri, 2 Aug 2013 22:48:09 +0200 (CEST)

On Fri, 2 Aug 2013, Howard wrote:

> I would like to use libcurl essentially to proxy an incoming connection. I
> have a process that is sending my process a series of buffers to be written
> and I want to use libcurl to write these buffers to a single file on the
> other side of an http connection.

libcurl can at least send the data in a POST or PUT request. The writing to a
file on the other side would be the job of the peer's HTTP server.

> It seems to me that I need some way to have libcurl not close the connection
> in between writes so I can assure that the file is written correctly on the
> other side.

If you want to do _one_ PUT, then certainly you would pass a long a stream of
data and not do a whole series of small PUTs, yes.

Keep feeding libcurl with data to its read callback!

> Has anyone done this or something similar? Is there example code around?

Here's an example of a HTTP PUT operation:

List admin:
Received on 2013-08-02