Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

document contains no data



On Sun, Aug 17, 2003 at 09:10:03AM -0400, ron.peterson at yellowbank.com wrote:

> I'm giving this a rest for the weekend.  If I make any progress with
> this, I'll post back to the thread.

Got it.  The problem was with the redirect script.  I had to eat the
request sent by the browser (the little while() loop..).  I also removed
the html, since it wasn't really contributing anything.  Works like a
charm.

#!/usr/bin/perl -w
# Name:     http-redirect
# Author:   Joe.Smith at MCI.com
# Modified: rpeterso at mtholyoke.edu
# Purpose:  Dummy http daemon redirects browers to specified www host.
# Usage:    Add "http 80/tcp" to /etc/services and add this to /etc/inetd.conf:
# http stream tcp nowait nobody /usr/local/etc/http-redirect host.domain.suf

# Set default host to use if not specified in inetd.conf
my $otherhost = @ARGV ? $ARGV[0] : "mill.mtholyoke.edu";

while(<STDIN>) {
    chomp;
    last if( /^\s*$/ );
}

my $message = <<EOM;
HTTP/1.1 302
Location: http://$otherhost/test/
Status: 302
Server: DUMMY/0.0
Content-type: text/html

EOM

$message =~ s/\n/\r\n/gm;       # Convert to netascii form, CR+LF
print $message;                 # Tell the browser to go away
exit;

-- 
Ron Peterson                   -o)
87 Taylor Street               /\\
Granby, MA  01033             _\_v
https://www.yellowbank.com/   ---- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
URL: <http://lists.blu.org/pipermail/discuss/attachments/20030818/8d921caf/attachment.sig>



BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org