#!/opt/perl-5.8.0/bin/perl use IO::Socket::INET; $|=1; $remote_host="biavl01.baplc.com"; $remote_port=1344; $socket = IO::Socket::INET->new(PeerAddr => $remote_host, PeerPort => $remote_port, Proto => "tcp", Type => SOCK_STREAM) or die "Couldn't connect to $remote_host:$remote_port : $!\n"; die "no socket" if ! defined $socket; # get text of respmod open(FH,"/home/u752359/respmod.txt"); undef $/; $respmod=; # send respmod over the socket, print $socket $respmod; # get response $|=1; @resp=<$socket>; print @resp; close($socket); #### RESPMOD icap://biavl01.baplc.com/avscan ICAP/1.0 Host: biavl01.baplc.com X-Scan-Progress-Interval: 3 X-Client-IP: 161.2.124.27 X-Server-IP: 161.2.66.50 Allow: 204 Encapsulated: req-hdr=0, res-hdr=142, res-body=460 GET /EICAR.COM HTTP/1.0 Host: ebiztools.baplc.com User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) HTTP/1.1 200 OK Date: Mon, 17 Oct 2005 10:22:01 GMT Server: Apache/2.0.54 (Unix) PHP/4.3.11 mod_jk/1.2.8 mod_perl/1.99_19 Perl/v5.8.3 Last-Modified: Fri, 14 Oct 2005 10:28:23 GMT ETag: "4260-45-512d5fc0" Accept-Ranges: bytes Content-Length: 68 Connection: close Content-Type: text/plain; charset=ISO-8859-1 44 X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H* 0