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.

gryphon
Whitepages.com
code('Perl') || die;


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

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.