trouble with get function and proxy

V

ver_for

Hi,

I use the get() function to get the content of web pages and it used to
work.

get("http://www.goggle.com")

Now the configuration of the network has changed, with the use of a
proxy to access the internet and now i do not get the results.

How should do?

The IP of the proxy is something like 255.255.255.254 and the port is
3615.

Thanks in advance for your answers,

Ver_for
 
B

Brian Wakem

Hi,

I use the get() function to get the content of web pages and it used to
work.

get("http://www.goggle.com")

Now the configuration of the network has changed, with the use of a
proxy to access the internet and now i do not get the results.

How should do?

The IP of the proxy is something like 255.255.255.254 and the port is
3615.

Thanks in advance for your answers,

Ver_for


www.google.com

Results 1 - 10 of about 80,600 for lwp proxy. (0.26 seconds)
 
V

ver_for

I have found two solutions that work.
1 - modifying the configuration of the OS

Under Windows NT or XP
Right click on "My Computer", click on "properties", select the
"environment" tab. These are your environment settings. Make the
following changes:

1. Add the setting HTTP_proxy, with your proxy name as the value
(you must include "http://" ), followed by a colon and the proxy port,
if applicable; e.g., "http://proxy:8080"
2. Add the setting HTTP_proxy_user, with your user name as the
value
3. Add the setting HTTP_proxy_pass, with your password as the
value

Under Windows 95
In your AUTOEXEC.BAT file, place the following lines then reboot so
the changes can take effect:

3. SET HTTP_proxy=<your proxy server (you must include "http://"
, followed by a colon and the proxy port, if applicable; e.g., SET HTTP_proxy=http://proxy:8080
4. SET HTTP_proxy_user=<your user name>
5. SET HTTP_proxy_pass=<your password>

2 - modifying the script perl

use LWP::Simple;
use LWP::UserAgent;

my $ua = LWP::UserAgent->new();
$ua->proxy( 'http', 'http://255.255.255.255:3615/');

my $req = HTTP::Request->new( GET => 'http://www.google.com/' );
my $res = $ua->request($req);
my $page = $res->content();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,141
Latest member
BlissKeto
Top