4 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
system("export http_proxy=\"http://service:3128\""); # Sichergehen das Proxy richtig eingestellt ist
my $ua = LWP::UserAgent->new;
$ua->timeout(10);
#$ua->env_proxy;
my $response = $ua->get('http://www.gom.com/');
#print $response;
if ($response->is_success) {
print $response->content; # or whatever
}
else {
print "shit!";
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
my $ua = LWP::UserAgent->new;#
$ua->timeout(10);
#$ua->env_proxy('HTTP',"http://service:3128"); So geht es auch nicht????
my $response = $ua->get('http://www.gom.com/');
#print $response;
if ($response->is_success) {
print $response->content; # or whatever
}
else {
print "shit!";
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$ENV{http_proxy} = 'http://service:3128';
my $ua = LWP::UserAgent->new;#
$ua->timeout(100);
my $response = $ua->get('http://www.gom.com/');
#print $response;
if ($response->is_success) {
print $response->content; # or whatever
}
else {
print "shit!";
}
my $content = $response->contene;
print $content if(defined $content);
$ua->proxy('http', 'http://server:3128/');
4 Einträge, 1 Seite |