|
Hi, All !!!
I want to get connention to some host through 2 proxies. Perl code : ----------------------------------------- #!e:/perl/bin/perl use Socket; $PROXY = '194.190.250.23';#first proxy $PORT = 80; $cont = "GET http://www.yahoo.com HTTP/1.1\n". "Host: www.yahoo.com\n". "Content-type: application/x-www-form-urlencoded\n". "Accept: */*\n". "Referer: www.somehost.com\n". "Connection: Keep-Alive\n\n"; socket(SH, PF_INET, SOCK_STREAM, getprotobyname('tcp')); connect(SH, sockaddr_in ($PORT, inet_aton($PROXY))) or {print "Error",die()}; select(SH); $| = 1; binmode SH; print SH "POST http://194.213.51.100:3128 HTTP/1.1\n".#194.213.51.100:3128 - second proxy "Host: 194.213.51.100:3128\n". "Accept: */*\n". "Referer: www.somehost.com\n", "Content-type: application/x-www-form-urlencoded\n", "Content-Length: ".length($cont)."\n\n"; print SH $cont; select(STDOUT); print "Content-Type: text/html\n\n"; while(<SH>){ print $_; } close(SH); ----------------------------------------- But the second proxy response : ERROR The requested URL could not be retrieved ---------------------------------------------------------------------------- ---- While trying to retrieve the URL: / The following error was encountered: a.. Invalid URL Some aspect of the requested URL is incorrect. Possible problems: a.. Missing or incorrect access protocol (should be `http://'' or similar) b.. Missing hostname c.. Illegal double-escape in the URL-Path d.. Illegal character in hostname; underscores are not allowed Your cache administrator is webmaster. ---------------------------------------------------------------------------- ---- Generated Wed, 25 Dec 2002 13:42:29 GMT by wwwftp.trionet.cz (Squid/2.3.STABLE4-hno.CVS) Request to 2-nd proxy not working. How to make right request to a second proxy ? |
- (no subject) karthikeyan
- RE: (no subject) Thomas_M
- (no subject) roboz
- (no subject) Greg Sidelinger
- (no subject) karthikeyan
- (no subject) Adam Frielink
- (no subject) $HeadHunter_Sid
- Re: (no subject) $Bill Luebkert
- Re: (no subject) Zac Morris \(personal\)
- Re: (no subject) Martin Moss
- (no subject) K Andrew
- (no subject) vinod
- (no subject) Eko Budiharto
- RE: (no subject) Gert Lombard
- RE: (no subject) / calling a html file Eko Budiharto
