I want to thank everyone that responds to my questions. I sincerely appreciate the help.
In the past I have received answers for using HTTP::Proxy, and I have learned how to use it and like it a lot. Very fast. My question, now, is about how to use stored header files to recreate the headers for a stored file (URI). I can successfully send the content of the file back to the client via:
my $res = HTTP::Response->new($status_code); $res->content_type('text/html'); #The following $content contains data within saved file pulled from we +b $res->content($content); #Let's push response back to client $self->proxy()->response($res);
$res->content_type('text/html');
I want to read in the entire file and use it to replicate what was originally received by the server the file was pulled from. Here is a sample of one of the files:
Connection: close Date: Sat, 24 Oct 2009 02:55:24 GMT Accept-Ranges: bytes ETag: "580d7-3e3e-45861df8" Server: Apache/1.3.29 (Unix) PHP/4.3.4 Content-Length: 15934 Content-Type: image/gif Last-Modified: Mon, 18 Dec 2006 17:12:40 GMT Client-Date: Sat, 24 Oct 2009 03:48:49 GMT Client-Response-Num: 1
Something worth noting is that the header file may contain mulitple lines with the same 'xyz:' field on the left, such as 'Links:'.
I want to read the file into a variable and just use something like the following to set up for returning to client.
# $header_file_content contains information from raw header dump file $res->headers($header_file_content);
Thank you in advance for your help
In reply to Help building response headers for HTTP proxy request by r1n0
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |