alfa's Avatar, Join Date: Jun 2009
Newbie Member
Thank you Mr.Pradeep for perl proxy.. Um using ur code for a project. We suppose to analyze the request from the browser before it reach the proxy..problem is we need to forward the web request to the Squid proxy running in the localhost in port 3128 (default)..i have tried many things, but unable to reach a perfect output.? could anyone help...

Thanks in advance..
alfa's Avatar, Join Date: Jun 2009
Newbie Member
thank u very for ur quick reply Mr.Pradeep..prevsly i tried that method (HTTP::Proxy)..but i need to see the request and file types send by the browser so ur code was well suited for that purpose..then i edited ur code to achive my target..
ur code was
$host = IO::Socket::INET->new (
PeerAddr=> $uri->host,
PeerPort=> $uri->port);

my Squid is running in localhost port 3128 so i replaced above like this
$host = IO::Socket::INET->new (
PeerAddr=> "",
PeerPort=> 3128);

i didnt changed anything then i run the code and configure the browser proxy for i got the reply from Squid but only error messages like Ileagal URL,..so i hope the request is going to Squid..but not the full URL is writen to Squid..coz some times error messages shows
When trying to retrive the URL:/webhp?hl=en ..

i didnt clearly understand the following part
binmode host

print $host "$method ".$uri->path_query." $httpVer\n";
print "$method ".$uri->path_query." $httpVer\n";

i think this is the portion where u writing the request to socket..if i could write the full request here then i hope i can send the full URL to SQUID..
Any suggestions.. to do that

Thank u very