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

Hi guys, I've been trying to connect to a socks proxy which requires username/password authentication. The socks proxy will be used to access some HTTP page. I found this useful perl module LWP::Protocol::socks through CPAN network but is unable to make it work for authentication. The following code with LWP::UserAgent with Basic Authentication works like charm:
$query = "http://www.google.com"; $proxy = "http://username:password\@proxy:port"; $ua->proxy('http',$proxy); $response = $ua->get($query);
However when i try to do the same thing with socks proxy
$query = "http://www.google.com"; $proxy = "socks://username:password\@proxy:port"; $ua->proxy('http',$proxy); $response = $ua->get($query);
It gives me error 500 Can't connect to www.google.com:80 (Timeout) Anyone has any idea ? Thanks in advance.

Replies are listed 'Best First'.
Re: LWP::Protocol::socks with authentication ?
by Anonymous Monk on Dec 27, 2008 at 16:45 UTC