Vinay has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, This is my first question. I am long time listener of this group and monks are doing great job in supporting community. Ok here it is:
proxy program:

#!/usr/bin/perl use HTTP::Proxy; use HTTP::Recorder; my $proxy = HTTP::Proxy->new(); #$proxy->host("my host name"); #I tried this with and without above line # create a new HTTP::Recorder object my $agent = new HTTP::Recorder ( file => "myfilezzz" ) or die; #$agent->proxy('http', "real-proxy"); #I tried with and without above line # set HTTP::Recorder as the agent for the proxy $proxy->agent( $agent ); # start the proxy $proxy->start(); 1;
I run above program in separate window, then I set proxy in browser (IE) and every thing works ( It creates myfilezzz file with contents $agent->get("http://myhost/myapp/"); ) except, I can't access any page(It says page not found or gives dns error). Looks like if we don't point browser to real-proxy it can't fetch page.
Am I missing something?

thanks Vinay

Edited by Chady -- added code tags.

Replies are listed 'Best First'.
Re: using http::record if inside fire wall
by PodMaster (Abbot) on Jun 18, 2004 at 05:18 UTC
    So you need to use a proxy ($foo) to be able to reach the internet because of your firewall? If that's the case, just supply HTTP::Proxy with a LWP::UserAgent object configured to use $foo.

    update: Why did you comment out #$agent->proxy('http', "real-proxy");? It sounds to me like that's what you're missing, but I can't really be sure (your description of what's going on isn't very clear).

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

      So you need to use a proxy ($foo) to be able to reach the internet because of your firewall? If that's the case, just supply HTTP::Proxy with a LWP::UserAgent object configured to use $foo.

      Thats correct, because of firewall I added
      $agent->proxy('http', "real-proxy");
      I did tried with above line uncommented but it does't work, I mean doesn't connect to internet.
      thanks
      Vinay
        Turn on debugging to figure out whats going on (see perldoc LWP::Debug)

        MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
        I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
        ** The third rule of perl club is a statement of fact: pod is sexy.