I've gotten involved with a couple of Perl modules that deal with Proxy Auto Configuration (PAC). The basic JavaScript function FindProxyForURL returns a proxy URL that includes a port (e.g., 800) but not a scheme (e.g., http). Yet LWP::UserAgent seems to want a scheme in the second operand of its $ua->proxy() call. My module(s) typically stand between these two software entities.

I've read some Web pages that recommend that the port used by proxy servers should not be any standard ones. Which means that my module would have a hard time deriving a scheme from the port number returned by FindProxyForURL.

The choices for my module are:
1. Always return http in the scheme part of the URI object it returns,
2. Return the scheme from the URL with which it was called, or
3. Return a URI object without a scheme.

Advice will be much appreciated. I should go find a network-oriented forum to ask this on, but Perl Monks know everything!

Thanks,
cmac

In reply to scheme for proxy? by cmac

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.