Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

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

by ioannis (Abbot)
on May 10, 2006 at 01:26 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2024-04-25 22:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found