cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl as a proxy

From: Manuel Arguelles <manuel.arguelles_at_wirelesszt.com>
Date: Fri, 13 Jan 2006 04:13:19 -0500

Do you know of any project like that? that I can take a look at the code?

with raw data I mean exactly the same that get's from the page, but with some
browsers I'm getting "bad http resonse" or "document contains no data", also
I'm printing all before sending it to the socket and

the options that I'm using are:

curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 0);

curl_easy_setopt(curl, CURLOPT_HEADER, 1);
curl_easy_setopt(curl, CURLOPT_AUTOREFERER, 0);
curl_easy_setopt(curl, CURLOPT_ENCODING, 0);

and for the images I'm getting something like this:
HTTP/1.1 200 OK
Date: Fri, 13 Jan 2006 09:06:05 GMT
Server: Apache/2.0.52 (Red Hat)
Last-Modified: Tue, 31 Aug 2004 21:36:50 GMT
ETag: "555efb-182-faa54080"
Accept-Ranges: bytes
Content-Length: 386
Cache-Control: max-age=3600
Expires: Fri, 13 Jan 2006 10:06:05 GMT
Connection: close
Content-Type: image/gif

GIF89aŠ

GIF89aŠ? where is the data... am I missing something?

On Thu 12 Jan 2006 16:50, Daniel Stenberg wrote:
> On Thu, 12 Jan 2006, Manuel Arguelles wrote:
> > What I'm doing is to open a listening socket, then when there's a request
> > accept it (new socket), fork, parse the request to get the url, pass it
> > to libcurl get the result, send it to the socket, close the socket.
> >
> > is there any especial options that I should consider?? does the
> > CURLOPT_WRITEDATA callback have the raw data?
>
> That can certainly be done, as has even been done in the past.
>
> I don't know what you mean with 'raw' data, but I would advice that you
> start off your venture by reading the tutorial:
>
> http://curl.haxx.se/libcurl/c/libcurl-tutorial.html
Received on 2006-01-13