Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Need help with HTTP::Proxy

by sunslinger (Initiate)
on Jul 04, 2006 at 07:22 UTC ( #559101=perlquestion: print w/replies, xml ) Need Help??
sunslinger has asked for the wisdom of the Perl Monks concerning the following question:

Hi guys,

I'm a newbie here with this particular problem. I'm currently using Win2K and am trying to use the WWW::Mechanize and HTTP::Proxy in order to submit a simple form where a proxy server address is required.

Here's my code:

my $proxy = HTTP::Proxy->new( host => '', port => 80, );

When I try to compile it, I get this error at dos prompt:

"Cannot initialize proxy daemon: Unknown error at C:/Perl/lib/HTTP/Pro line 268."

Please help!

Code tags added by GrandFather

Replies are listed 'Best First'.
Re: Need help with HTTP::Proxy
by shmem (Chancellor) on Jul 04, 2006 at 10:28 UTC
    HTTP::Proxy is used to setup a proxy on your machine, which is probably not what you want.

    If the submit request must go over a remote proxy, set the environment variable http_proxy or include the following snippet in your script:

    $ENV{'http_proxy'} = '';


    _($_=" "x(1<<5)."?\n".q/)Oo.  G\        /
                                  /\_/(q    /
    ----------------------------  \__(m.====.(_("always off the crowd"))."
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
Re: Need help with HTTP::Proxy
by Corion (Pope) on Jul 04, 2006 at 07:32 UTC

    Most likely, the address cannot be bound to an interface of your network card. Make sure that resolves to the machine you run your proxy on and that one network interface handles the IP address.

    But why are you setting the host parameter at all? It shouldn't be necessary - try your code without it, or try giving it an IP address instead of a hostname, to eliminate DNS weirdness.

Re: Need help with HTTP::Proxy
by planetscape (Chancellor) on Jul 04, 2006 at 13:04 UTC
      Hi planetscape, I think you're spot on with my dilemma. Sorry if I wasn't clear enough as I'm really, really new with this. I tried the WWW::Mechanize via $mech->proxy(etc.) and compilation is ok. Then when I try to load the page $mech->get($url); I get this run-time(?) error:- Error GETing http://home/intranet/soemthing.htm: Proxy Authentication Required. The ISA server requires authorization to fulfill the request. Access to the Web Proxy service is denied. > at at line 27 So basically I'm trying to get WWW::Mechanize to submit a form (I think) but the html page is behind my office's proxy and it prompts me for authentication. Please help!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://559101]
Approved by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2018-05-27 16:28 GMT
Find Nodes?
    Voting Booth?