Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: Embedding "user" CGI output into a mod_perl response

by ioannis (Abbot)
on May 10, 2006 at 01:26 UTC ( #548359=note: print w/replies, xml ) Need Help??

in reply to Embedding "user" CGI output into a mod_perl response

To customize the response to the browser, you will need to capture the output from the cgi script. For cgi scripts at another machine, your Apache handler will in affect act as a forward proxy to the request: it will send the request with LWP::UserAgent and capture the output with LWP::Response.

There is no difficulty if you know the Apache API. Just ensure sure that all incoming and outgoing headers are copied, especially the HTTP headers that may appear twice, like Cookie -- you cannot use functions like $r->headers_in that return hash structures, thus suppressing the second Cookie header.

  • Comment on Re: Embedding "user" CGI output into a mod_perl response

Replies are listed 'Best First'.
Re^2: Embedding "user" CGI output into a mod_perl response
by bmcatt (Friar) on May 10, 2006 at 01:38 UTC
    This is actually going to be for cgi scripts that are deployed (in the current "old" system) on the same system, so there's no need to act as a full proxy. Theoretically, I *should* be able to just use some aspect of the Apache interface(s) to fire off the CGI script "inline" and then extract the body of the response.

    Thanks for the suggestion, though. I'd already thought of proxying it, but that then leaves me needing to have an exposed (in the sense of publicly-visible) cgi interface and I'm explicitly trying to avoid that.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://548359]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (1)
As of 2022-09-30 21:54 GMT
Find Nodes?
    Voting Booth?
    I prefer my indexes to start at:

    Results (126 votes). Check out past polls.