Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use proxy with perl script

Tags:

proxy

perl

I want to use a proxy with this perl script but I'm not sure how to make it use a proxy.

#!/usr/bin/perl
use IO::Socket;
$remote = IO::Socket::INET->new(
                        Proto    => "tcp",
                        PeerAddr => "localhost",
                        PeerPort => "8080",
                    )
                  or die "cannot connect";
print $remote "GET / HTTP/1.0\n\n";
    while ( <$remote> ) { print }
like image 882
Hintswen Avatar asked Dec 02 '22 06:12

Hintswen


1 Answers

Use the LWP::UserAgent module, which has built-in proxy support.

like image 193
AmbroseChapel Avatar answered Dec 22 '22 02:12

AmbroseChapel