- #!/usr/local/bin/perl
- require 'sys/socket.ph';
- $url = shift || die "usage: $0: urln";
- $proxy = 'localhost';
- $port = 3128;
- $url = "http://$url/" if ($url =~ /^[-w.]+$/);
- print "Querying cache path to $urln";
- $host = $1 if ($url =~ /^[^:]+://([^/:]+)/);
- $sockaddr = 'S n a4 x8';
- ($name, $aliases, $proto) = getprotobyname("tcp");
- ($fqdn, $aliases, $type, $len, $thataddr) = gethostbyname($proxy);
- $thissock = pack($sockaddr, &AF_INET, 0, "