Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Greetings fellow monks,

I've been working on a spike for an idea I had: Taking an existing and fairly complex CGI::Application web app and wrapping it inside a Net::HTTPServer script. The idea being that I want to have the core application continue to live on an Apache mod_perl server for general use, but I'd also like to be able to transport the whole thing on a thumbnail drive. The app would be used by "less than completely technical" folk, so I'd like to be able to say, "Plug this into there, then double-click this."

Using $ENV{CGI_APP_RETURN_ONLY} = 1, I'm capturing the web app's output, then I'm seperating the header from the body and having the wrapper script set the appropriate Net::HTTPServer stuff. This works well for GET requests, but it starts to fall appart for POSTs and reading /writing cookies. Ultimately, what I'd love to be able to do is just have my wrapper script pass the request directly to the web app, then return directly whatever the web app returns.

Has anyone done this before? Is Net::HTTPServer the appropriate method? I'm not married to the module, so I'm happy to try something else. With a little work, I can get my wrapper script to do everything I want it to, but it seems kinda silly and a waste of time given that there's bound to be something already done for this sort of thing.

Thanks in advance for your help.

code('Perl') || die;

In reply to Net::HTTPServer wrapped CGI::Application by gryphon

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2021-08-02 22:32 GMT
Find Nodes?
    Voting Booth?
    My primary motivation for participating at PerlMonks is: (Choices in context)

    Results (31 votes). Check out past polls.