Better way to proxy an HTTP request using Perl HTTP::Response and LWP? -
i need perl cgi script fetches url , returns result of fetch - status, headers , content - unaltered cgi environment "proxied" url returned web server user's browser if they'd accessed url directly. i'm running script cgi-bin in apache web server on ubuntu 14.04 host, question should independent of server platform - can run perl cgi scripts should able it. i've tried using lwp::useragent::request() , i've got close. returns http::response object contains status code, headers , content, , has "as_string" method turns human-readable form. problem cgi perspective "as string" converts status code "http/1.1 200 ok" rather "status: 200 ok", apache server doesn't recognise output valid cgi response. i can fix using other methods in http::response split out various parts, there seems no public way of getting @ encapsulated http::headers object in order call as_string method; instead have hack perl blessed obj...