curl-library
Re: Question about proxying using curl
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:
http://curl.haxx.se/libcurl/c/httpput.html
-- / daniel.haxx.se ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.htmlReceived on 2013-08-02